(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
(FPCore (x y z t a)
:precision binary64
(if (<= y -7.319216852213493e+57)
(+ x (* (- z t) (/ y (- z a))))
(if (<= y 5.547445071430195e-141)
(+ x (/ (* y (- z t)) (- z a)))
(fma y (/ (- z t) (- z a)) 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 tmp;
if (y <= -7.319216852213493e+57) {
tmp = x + ((z - t) * (y / (z - a)));
} else if (y <= 5.547445071430195e-141) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = fma(y, ((z - t) / (z - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function code(x, y, z, t, a) tmp = 0.0 if (y <= -7.319216852213493e+57) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))); elseif (y <= 5.547445071430195e-141) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))); else tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -7.319216852213493e+57], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.547445071430195e-141], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \leq -7.319216852213493 \cdot 10^{+57}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;y \leq 5.547445071430195 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, 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 | 1.4 |
|---|---|
| Target | 1.2 |
| Herbie | 1.3 |
if y < -7.3192168522134934e57Initial program 0.4
Taylor expanded in y around 0 29.1
Applied *-un-lft-identity_binary6429.1
Applied times-frac_binary643.3
Simplified3.3
if -7.3192168522134934e57 < y < 5.5474450714301953e-141Initial program 2.1
Taylor expanded in y around 0 0.9
if 5.5474450714301953e-141 < y Initial program 0.8
Simplified0.8
Final simplification1.3
herbie shell --seed 2022129
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))