x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
t_1 := \sqrt[3]{z - t}\\
t_2 := \sqrt[3]{a - t}\\
x + \left(y \cdot \frac{t_1 \cdot t_1}{t_2 \cdot t_2}\right) \cdot \frac{t_1}{t_2}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (cbrt (- z t))) (t_2 (cbrt (- a t)))) (+ x (* (* y (/ (* t_1 t_1) (* t_2 t_2))) (/ t_1 t_2)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = cbrt(z - t);
double t_2 = cbrt(a - t);
return x + ((y * ((t_1 * t_1) / (t_2 * t_2))) * (t_1 / t_2));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
Initial program 1.4
Applied add-cube-cbrt_binary641.9
Applied add-cube-cbrt_binary641.8
Applied times-frac_binary641.8
Applied associate-*r*_binary640.5
Final simplification0.5
herbie shell --seed 2022076
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))