(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 (- INFINITY))
(fma y (/ (- z t) (- z a)) x)
(if (<= t_1 7.177294426869409e+236)
(+ t_1 x)
(fma (/ y (- z a)) (- z t) x)))))double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(y, ((z - t) / (z - a)), x);
} else if (t_1 <= 7.177294426869409e+236) {
tmp = t_1 + x;
} else {
tmp = fma((y / (z - a)), (z - t), x);
}
return tmp;
}
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x); elseif (t_1 <= 7.177294426869409e+236) tmp = Float64(t_1 + x); else tmp = fma(Float64(y / Float64(z - a)), Float64(z - t), x); end return tmp end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 7.177294426869409e+236], N[(t$95$1 + x), $MachinePrecision], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]]]]
x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\
\mathbf{elif}\;t_1 \leq 7.177294426869409 \cdot 10^{+236}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.8 |
|---|---|
| Target | 1.2 |
| Herbie | 0.5 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 64.0
Simplified0.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 7.17729442686940866e236Initial program 0.3
if 7.17729442686940866e236 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 53.9
Simplified1.5
Applied clear-num_binary641.5
Applied div-inv_binary641.6
Applied *-un-lft-identity_binary641.6
Applied times-frac_binary641.6
Taylor expanded in y around 0 53.9
Simplified3.2
Final simplification0.5
herbie shell --seed 2022129
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))