(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 (/ (* y (- z t)) (- a t))))
(if (<= t_1 -4.7126067703191754e+24)
(fma (/ y (- a t)) (- z t) x)
(if (<= t_1 3.3293842485947703e+274)
(+ t_1 x)
(+ x (/ y (/ (- a t) (- z t))))))))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 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -4.7126067703191754e+24) {
tmp = fma((y / (a - t)), (z - t), x);
} else if (t_1 <= 3.3293842485947703e+274) {
tmp = t_1 + x;
} else {
tmp = x + (y / ((a - t) / (z - t)));
}
return tmp;
}
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_1 <= -4.7126067703191754e+24) tmp = fma(Float64(y / Float64(a - t)), Float64(z - t), x); elseif (t_1 <= 3.3293842485947703e+274) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))); end return tmp end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4.7126067703191754e+24], N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 3.3293842485947703e+274], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -4.7126067703191754 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{elif}\;t_1 \leq 3.3293842485947703 \cdot 10^{+274}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.2 |
|---|---|
| Target | 1.3 |
| Herbie | 0.8 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -4.71260677031917545e24Initial program 24.8
Simplified2.7
Applied egg-rr2.8
Applied egg-rr2.2
Applied egg-rr2.5
if -4.71260677031917545e24 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 3.32938424859477035e274Initial program 0.3
if 3.32938424859477035e274 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 59.0
Simplified0.7
Applied egg-rr0.8
Applied egg-rr0.7
Final simplification0.8
herbie shell --seed 2022153
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))