x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -3.3348818478163845 \cdot 10^{-40}:\\
\;\;\;\;\frac{z}{\frac{a - t}{y - x}} - \mathsf{fma}\left(\frac{t}{a - t}, y - x, -1 \cdot x\right)\\
\mathbf{elif}\;t \le 1.87885427265612864 \cdot 10^{-162}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{elif}\;t \le 5.014268344444687 \cdot 10^{226}:\\
\;\;\;\;\frac{\sqrt[3]{z}}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{\sqrt[3]{z}}} \cdot \frac{\sqrt[3]{z}}{\frac{\sqrt[3]{a - t}}{y - x}} - \left(\frac{t}{\frac{a - t}{y - x}} - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r588558 = x;
double r588559 = y;
double r588560 = r588559 - r588558;
double r588561 = z;
double r588562 = t;
double r588563 = r588561 - r588562;
double r588564 = r588560 * r588563;
double r588565 = a;
double r588566 = r588565 - r588562;
double r588567 = r588564 / r588566;
double r588568 = r588558 + r588567;
return r588568;
}
double f(double x, double y, double z, double t, double a) {
double r588569 = t;
double r588570 = -3.3348818478163845e-40;
bool r588571 = r588569 <= r588570;
double r588572 = z;
double r588573 = a;
double r588574 = r588573 - r588569;
double r588575 = y;
double r588576 = x;
double r588577 = r588575 - r588576;
double r588578 = r588574 / r588577;
double r588579 = r588572 / r588578;
double r588580 = r588569 / r588574;
double r588581 = -1.0;
double r588582 = r588581 * r588576;
double r588583 = fma(r588580, r588577, r588582);
double r588584 = r588579 - r588583;
double r588585 = 1.8788542726561286e-162;
bool r588586 = r588569 <= r588585;
double r588587 = r588572 - r588569;
double r588588 = r588587 / r588574;
double r588589 = fma(r588588, r588577, r588576);
double r588590 = 5.014268344444687e+226;
bool r588591 = r588569 <= r588590;
double r588592 = cbrt(r588572);
double r588593 = cbrt(r588574);
double r588594 = r588593 * r588593;
double r588595 = r588594 / r588592;
double r588596 = r588592 / r588595;
double r588597 = r588593 / r588577;
double r588598 = r588592 / r588597;
double r588599 = r588596 * r588598;
double r588600 = r588569 / r588578;
double r588601 = r588600 - r588576;
double r588602 = r588599 - r588601;
double r588603 = r588576 / r588569;
double r588604 = r588572 * r588575;
double r588605 = r588604 / r588569;
double r588606 = r588575 - r588605;
double r588607 = fma(r588603, r588572, r588606);
double r588608 = r588591 ? r588602 : r588607;
double r588609 = r588586 ? r588589 : r588608;
double r588610 = r588571 ? r588584 : r588609;
return r588610;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 24.1 |
|---|---|
| Target | 9.3 |
| Herbie | 9.8 |
if t < -3.3348818478163845e-40Initial program 34.2
Simplified18.9
rmApplied clear-num19.1
rmApplied fma-udef19.2
Simplified19.2
rmApplied div-sub19.1
Applied associate-+l-15.6
rmApplied associate-/r/13.1
Applied fma-neg13.1
Simplified13.1
if -3.3348818478163845e-40 < t < 1.8788542726561286e-162Initial program 8.6
Simplified8.3
rmApplied clear-num8.4
rmApplied fma-udef8.4
Simplified7.9
rmApplied associate-/r/3.9
Applied fma-def3.9
if 1.8788542726561286e-162 < t < 5.014268344444687e+226Initial program 22.7
Simplified13.1
rmApplied clear-num13.3
rmApplied fma-udef13.4
Simplified13.1
rmApplied div-sub13.1
Applied associate-+l-10.4
rmApplied *-un-lft-identity10.4
Applied add-cube-cbrt10.7
Applied times-frac10.7
Applied add-cube-cbrt10.8
Applied times-frac9.9
Simplified10.0
if 5.014268344444687e+226 < t Initial program 51.1
Simplified30.3
rmApplied clear-num30.9
rmApplied fma-udef30.9
Simplified30.9
Taylor expanded around inf 22.7
Simplified18.8
Final simplification9.8
herbie shell --seed 2020064 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))