x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \leq -2.7652237220585614 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\
\mathbf{elif}\;a \leq 7.901198986015583 \cdot 10^{-256}:\\
\;\;\;\;\left(t + \frac{x \cdot y}{z}\right) - \frac{y \cdot t}{z}\\
\mathbf{elif}\;a \leq 4.83371996350502 \cdot 10^{-136}:\\
\;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{\sqrt[3]{a - z}}} \cdot \frac{\frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}}{\sqrt[3]{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}}\right)\\
\mathbf{elif}\;a \leq 1.886559025907838 \cdot 10^{-47}:\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t - x}{\sqrt[3]{a - z}}\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.7652237220585614e-141)
(+
x
(*
(/ (- y z) (* (cbrt (- a z)) (cbrt (- a z))))
(/ (- t x) (cbrt (- a z)))))
(if (<= a 7.901198986015583e-256)
(- (+ t (/ (* x y) z)) (/ (* y t) z))
(if (<= a 4.83371996350502e-136)
(+
x
(*
(/ (* (cbrt (- y z)) (cbrt (- y z))) (cbrt (- a z)))
(*
(/ (- t x) (cbrt (cbrt (- a z))))
(/
(/ (cbrt (- y z)) (cbrt (- a z)))
(cbrt (* (cbrt (- a z)) (cbrt (- a z))))))))
(if (<= a 1.886559025907838e-47)
(+ t (* y (- (/ x z) (/ t z))))
(+
x
(*
(/ (- y z) (* (cbrt (- a z)) (cbrt (- a z))))
(/ (- t x) (cbrt (- a z))))))))))double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7652237220585614e-141) {
tmp = x + (((y - z) / (cbrt(a - z) * cbrt(a - z))) * ((t - x) / cbrt(a - z)));
} else if (a <= 7.901198986015583e-256) {
tmp = (t + ((x * y) / z)) - ((y * t) / z);
} else if (a <= 4.83371996350502e-136) {
tmp = x + (((cbrt(y - z) * cbrt(y - z)) / cbrt(a - z)) * (((t - x) / cbrt(cbrt(a - z))) * ((cbrt(y - z) / cbrt(a - z)) / cbrt(cbrt(a - z) * cbrt(a - z)))));
} else if (a <= 1.886559025907838e-47) {
tmp = t + (y * ((x / z) - (t / z)));
} else {
tmp = x + (((y - z) / (cbrt(a - z) * cbrt(a - z))) * ((t - x) / cbrt(a - z)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.9 |
|---|---|
| Target | 12.1 |
| Herbie | 11.7 |
if a < -2.76522372205856143e-141 or 1.88655902590783809e-47 < a Initial program 23.1
rmApplied add-cube-cbrt_binary6423.4
Applied times-frac_binary648.9
if -2.76522372205856143e-141 < a < 7.9011989860155833e-256Initial program 30.9
rmApplied add-cube-cbrt_binary6431.5
Applied times-frac_binary6421.9
Taylor expanded around inf 12.8
Simplified12.8
if 7.9011989860155833e-256 < a < 4.8337199635050203e-136Initial program 30.7
rmApplied add-cube-cbrt_binary6431.3
Applied times-frac_binary6421.6
rmApplied add-cube-cbrt_binary6421.6
Applied cbrt-prod_binary6421.7
Applied *-un-lft-identity_binary6421.7
Applied times-frac_binary6421.7
Applied associate-*r*_binary6421.1
Simplified21.1
rmApplied *-un-lft-identity_binary6421.1
Applied add-cube-cbrt_binary6420.9
Applied times-frac_binary6420.9
Applied times-frac_binary6420.9
Applied associate-*l*_binary6421.3
Simplified21.3
if 4.8337199635050203e-136 < a < 1.88655902590783809e-47Initial program 23.1
Taylor expanded around inf 28.7
Simplified24.7
Final simplification11.7
herbie shell --seed 2020219
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))
(+ x (/ (* (- y z) (- t x)) (- a z))))