(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* x (- y z)) y)) (t_1 (- x (/ x (/ y z)))))
(if (<= t_0 -2e+272)
(fma (/ (- z) y) x x)
(if (<= t_0 -4e+41)
(- x (* (/ 1.0 y) (/ z (/ 1.0 x))))
(if (<= t_0 1e-112)
t_1
(if (<= t_0 5e+291) (- x (pow (/ y (* x z)) -1.0)) t_1))))))double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
double code(double x, double y, double z) {
double t_0 = (x * (y - z)) / y;
double t_1 = x - (x / (y / z));
double tmp;
if (t_0 <= -2e+272) {
tmp = fma((-z / y), x, x);
} else if (t_0 <= -4e+41) {
tmp = x - ((1.0 / y) * (z / (1.0 / x)));
} else if (t_0 <= 1e-112) {
tmp = t_1;
} else if (t_0 <= 5e+291) {
tmp = x - pow((y / (x * z)), -1.0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function code(x, y, z) t_0 = Float64(Float64(x * Float64(y - z)) / y) t_1 = Float64(x - Float64(x / Float64(y / z))) tmp = 0.0 if (t_0 <= -2e+272) tmp = fma(Float64(Float64(-z) / y), x, x); elseif (t_0 <= -4e+41) tmp = Float64(x - Float64(Float64(1.0 / y) * Float64(z / Float64(1.0 / x)))); elseif (t_0 <= 1e-112) tmp = t_1; elseif (t_0 <= 5e+291) tmp = Float64(x - (Float64(y / Float64(x * z)) ^ -1.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+272], N[(N[((-z) / y), $MachinePrecision] * x + x), $MachinePrecision], If[LessEqual[t$95$0, -4e+41], N[(x - N[(N[(1.0 / y), $MachinePrecision] * N[(z / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-112], t$95$1, If[LessEqual[t$95$0, 5e+291], N[(x - N[Power[N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\frac{x \cdot \left(y - z\right)}{y}
\begin{array}{l}
t_0 := \frac{x \cdot \left(y - z\right)}{y}\\
t_1 := x - \frac{x}{\frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+272}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-z}{y}, x, x\right)\\
\mathbf{elif}\;t_0 \leq -4 \cdot 10^{+41}:\\
\;\;\;\;x - \frac{1}{y} \cdot \frac{z}{\frac{1}{x}}\\
\mathbf{elif}\;t_0 \leq 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+291}:\\
\;\;\;\;x - {\left(\frac{y}{x \cdot z}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
| Original | 12.2 |
|---|---|
| Target | 2.8 |
| Herbie | 0.5 |
if (/.f64 (*.f64 x (-.f64 y z)) y) < -2.0000000000000001e272Initial program 51.6
Simplified4.8
Applied egg-rr2.9
if -2.0000000000000001e272 < (/.f64 (*.f64 x (-.f64 y z)) y) < -4.00000000000000002e41Initial program 0.2
Simplified5.9
Applied egg-rr0.2
if -4.00000000000000002e41 < (/.f64 (*.f64 x (-.f64 y z)) y) < 9.9999999999999995e-113 or 5.0000000000000001e291 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 16.2
Simplified3.6
Applied egg-rr6.6
Applied egg-rr0.3
if 9.9999999999999995e-113 < (/.f64 (*.f64 x (-.f64 y z)) y) < 5.0000000000000001e291Initial program 0.3
Simplified4.8
Applied egg-rr0.2
Final simplification0.5
herbie shell --seed 2022210
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))