x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \leq -5.615091370569311 \cdot 10^{-59}:\\
\;\;\;\;t \cdot \left(\frac{y - z}{a - z} + \frac{z - z}{a - z}\right) + x\\
\mathbf{elif}\;t \leq 1.0616679928509863 \cdot 10^{-130}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{a - z}\\
x + \frac{t \cdot \left(\frac{y}{t_1} - \frac{z}{t_1}\right)}{t_1 \cdot t_1}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a - z} - \frac{z}{a - z}, x\right)\\
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.615091370569311e-59)
(+ (* t (+ (/ (- y z) (- a z)) (/ (- z z) (- a z)))) x)
(if (<= t 1.0616679928509863e-130)
(let* ((t_1 (cbrt (- a z))))
(+ x (/ (* t (- (/ y t_1) (/ z t_1))) (* t_1 t_1))))
(fma t (- (/ y (- a z)) (/ z (- a z))) x))))double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.615091370569311e-59) {
tmp = (t * (((y - z) / (a - z)) + ((z - z) / (a - z)))) + x;
} else if (t <= 1.0616679928509863e-130) {
double t_1 = cbrt(a - z);
tmp = x + ((t * ((y / t_1) - (z / t_1))) / (t_1 * t_1));
} else {
tmp = fma(t, ((y / (a - z)) - (z / (a - z))), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.5 |
|---|---|
| Target | 0.6 |
| Herbie | 0.9 |
if t < -5.6150913705693108e-59Initial program 18.8
Simplified2.2
Applied fma-udef_binary642.2
Simplified0.5
Applied div-inv_binary640.6
Applied div-inv_binary640.6
Applied distribute-rgt-out--_binary640.6
Applied add-cube-cbrt_binary641.0
Applied add-cube-cbrt_binary641.3
Applied prod-diff_binary641.3
Applied distribute-rgt-in_binary641.3
Simplified0.6
Simplified0.5
if -5.6150913705693108e-59 < t < 1.06166799285098628e-130Initial program 0.5
Simplified3.8
Applied fma-udef_binary643.8
Simplified3.0
Applied add-cube-cbrt_binary643.1
Applied *-un-lft-identity_binary643.1
Applied times-frac_binary643.1
Applied add-cube-cbrt_binary643.2
Applied *-un-lft-identity_binary643.2
Applied times-frac_binary643.2
Applied distribute-lft-out--_binary643.2
Applied associate-*r*_binary643.2
Applied un-div-inv_binary643.2
Applied associate-*l/_binary641.3
if 1.06166799285098628e-130 < t Initial program 14.9
Simplified2.7
Applied fma-udef_binary642.7
Simplified0.8
Applied fma-def_binary640.8
Final simplification0.9
herbie shell --seed 2021313
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))