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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 16.3 |
|---|---|
| Target | 8.5 |
| Herbie | 7.3 |
if t < -1.2329906028711256e76Initial program 28.4
Simplified18.5
Taylor expanded in t around inf 15.4
Simplified8.8
Applied *-commutative_binary648.8
if -1.2329906028711256e76 < t < 5.77739043033141842e162Initial program 9.6
Simplified7.1
Applied div-inv_binary647.1
Applied pow1_binary647.1
Applied pow1_binary647.1
Applied pow-prod-down_binary647.1
Simplified7.1
if 5.77739043033141842e162 < t Initial program 32.8
Simplified22.7
Taylor expanded in t around inf 16.1
Simplified6.0
Taylor expanded in t around -inf 16.1
Simplified5.6
Final simplification7.3
herbie shell --seed 2022129
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))