Intel library 2.0u2

Discussion around the SwissMicros DM42 calculator
David
Posts: 20
Joined: Fri Apr 07, 2017 7:32 am

Re: Intel library 2.0u2

Post by David »

Thomas,
All my fixes are included in 2.02 (or at least functional equivalents), but they are anyway irrelevant for Free42 as it has own workarounds for problems I'm aware of (and which could affect Free42 functionality).
Thomas Okken
Posts: 1102
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Intel library 2.0u2

Post by Thomas Okken »

Walter wrote:
Wed Mar 06, 2019 7:46 pm
ctrclckws wrote:
Wed Mar 06, 2019 5:59 pm
And now, after lots of thought, you know what the comment should be.
Thus, now's the time to record it ;)
What I should have written in the first place was this:

Code: Select all

// In core_commands6.cc

static int mappable_acos_r(phloat x, phloat *y) {
    if (x < -1 || x > 1)
        return ERR_INVALID_DATA;
    if (!flags.f.rad)
        if (x == 0) {
            *y = flags.f.grad ? 100 : 90;
            return ERR_NONE;
        } else if (x == -1) {
            *y = flags.f.grad ? 200 : 180;
            return ERR_NONE;
        }
    *y = rad_to_angle(acos(x));
    return ERR_NONE;
}

// In core_phloat.cc

Phloat acos(Phloat p) {
    if (p == -1)
        /* Intel library bug work-around */
        return PI;
    BID_UINT128 res;
    bid128_acos(&res, &p.val);
    return Phloat(res);
}
That would have been cleaner.
But the existing code works, so, meh. ;-)
David wrote:
Thu Mar 07, 2019 11:11 am
All my fixes are included in 2.02 (or at least functional equivalents), but they are anyway irrelevant for Free42 as it has own workarounds for problems I'm aware of (and which could affect Free42 functionality).
I agree. All I can see is the fix for the acos(-1) bug in bid128_acos(), which Free42 works around already; the integral-exponents logic in bid128_pow(), which Free42 doesn't need because it implements that logic itself; and a fix in bid128_exp10(), which doesn't apply because Free42 uses pow(10, x) instead of exp10(x).

OK, so I'll remove 2.0u2 from my repo and leave everything else the way it is.
Post Reply