
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + y) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + y) / (1.0d0 - (y / z))
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
def code(x, y, z): return (x + y) / (1.0 - (y / z))
function code(x, y, z) return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) end
function tmp = code(x, y, z) tmp = (x + y) / (1.0 - (y / z)); end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}
(FPCore (x y z) :precision binary64 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z))))) (if (or (<= t_0 -1e-288) (not (<= t_0 0.0))) t_0 (* z (/ (- (- y) x) y)))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-288) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((-y - x) / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-1d-288)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z * ((-y - x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-288) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((-y - x) / y);
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -1e-288) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * ((-y - x) / y) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))) tmp = 0.0 if ((t_0 <= -1e-288) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(Float64(Float64(-y) - x) / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + y) / (1.0 - (y / z)); tmp = 0.0; if ((t_0 <= -1e-288) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * ((-y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e-288], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(N[((-y) - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-288} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{\left(-y\right) - x}{y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1.00000000000000006e-288 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.9%
if -1.00000000000000006e-288 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 6.1%
Taylor expanded in z around 0 99.6%
mul-1-neg99.6%
associate-/l*6.1%
+-commutative6.1%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -3.9e-29) (+ x y) (if (<= z 7.2e-128) (/ (* z (- (- y) x)) y) (+ x y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.9e-29) {
tmp = x + y;
} else if (z <= 7.2e-128) {
tmp = (z * (-y - x)) / y;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.9d-29)) then
tmp = x + y
else if (z <= 7.2d-128) then
tmp = (z * (-y - x)) / y
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.9e-29) {
tmp = x + y;
} else if (z <= 7.2e-128) {
tmp = (z * (-y - x)) / y;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.9e-29: tmp = x + y elif z <= 7.2e-128: tmp = (z * (-y - x)) / y else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.9e-29) tmp = Float64(x + y); elseif (z <= 7.2e-128) tmp = Float64(Float64(z * Float64(Float64(-y) - x)) / y); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.9e-29) tmp = x + y; elseif (z <= 7.2e-128) tmp = (z * (-y - x)) / y; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.9e-29], N[(x + y), $MachinePrecision], If[LessEqual[z, 7.2e-128], N[(N[(z * N[((-y) - x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-29}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-128}:\\
\;\;\;\;\frac{z \cdot \left(\left(-y\right) - x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.8999999999999998e-29 or 7.20000000000000049e-128 < z Initial program 98.1%
Taylor expanded in z around inf 81.2%
if -3.8999999999999998e-29 < z < 7.20000000000000049e-128Initial program 60.7%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
+-commutative80.2%
*-commutative80.2%
+-commutative80.2%
Simplified80.2%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.8e-16) (+ x y) (if (<= z 3.05e-127) (* z (/ (- (- y) x) y)) (+ x y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.8e-16) {
tmp = x + y;
} else if (z <= 3.05e-127) {
tmp = z * ((-y - x) / y);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.8d-16)) then
tmp = x + y
else if (z <= 3.05d-127) then
tmp = z * ((-y - x) / y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.8e-16) {
tmp = x + y;
} else if (z <= 3.05e-127) {
tmp = z * ((-y - x) / y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.8e-16: tmp = x + y elif z <= 3.05e-127: tmp = z * ((-y - x) / y) else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.8e-16) tmp = Float64(x + y); elseif (z <= 3.05e-127) tmp = Float64(z * Float64(Float64(Float64(-y) - x) / y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.8e-16) tmp = x + y; elseif (z <= 3.05e-127) tmp = z * ((-y - x) / y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.8e-16], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.05e-127], N[(z * N[(N[((-y) - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-16}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-127}:\\
\;\;\;\;z \cdot \frac{\left(-y\right) - x}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.80000000000000012e-16 or 3.0499999999999999e-127 < z Initial program 98.1%
Taylor expanded in z around inf 81.2%
if -3.80000000000000012e-16 < z < 3.0499999999999999e-127Initial program 60.7%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
associate-/l*45.7%
+-commutative45.7%
associate-/r/80.7%
distribute-rgt-neg-in80.7%
+-commutative80.7%
Simplified80.7%
Final simplification81.0%
(FPCore (x y z)
:precision binary64
(if (<= y -1.15e+79)
(- z)
(if (<= y -6.2e-135)
(/ x (- 1.0 (/ y z)))
(if (<= y 3e+71) (+ x y) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.15e+79) {
tmp = -z;
} else if (y <= -6.2e-135) {
tmp = x / (1.0 - (y / z));
} else if (y <= 3e+71) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.15d+79)) then
tmp = -z
else if (y <= (-6.2d-135)) then
tmp = x / (1.0d0 - (y / z))
else if (y <= 3d+71) then
tmp = x + y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.15e+79) {
tmp = -z;
} else if (y <= -6.2e-135) {
tmp = x / (1.0 - (y / z));
} else if (y <= 3e+71) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.15e+79: tmp = -z elif y <= -6.2e-135: tmp = x / (1.0 - (y / z)) elif y <= 3e+71: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.15e+79) tmp = Float64(-z); elseif (y <= -6.2e-135) tmp = Float64(x / Float64(1.0 - Float64(y / z))); elseif (y <= 3e+71) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.15e+79) tmp = -z; elseif (y <= -6.2e-135) tmp = x / (1.0 - (y / z)); elseif (y <= 3e+71) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.15e+79], (-z), If[LessEqual[y, -6.2e-135], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+71], N[(x + y), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+79}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-135}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+71}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.15e79 or 3.00000000000000013e71 < y Initial program 51.3%
Taylor expanded in y around inf 81.5%
mul-1-neg81.5%
Simplified81.5%
if -1.15e79 < y < -6.2000000000000001e-135Initial program 100.0%
Taylor expanded in x around inf 71.5%
if -6.2000000000000001e-135 < y < 3.00000000000000013e71Initial program 99.2%
Taylor expanded in z around inf 82.0%
Final simplification79.8%
(FPCore (x y z) :precision binary64 (if (<= y -7.6e+79) (- z) (if (<= y 1.4e+69) (+ x y) (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+79) {
tmp = -z;
} else if (y <= 1.4e+69) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-7.6d+79)) then
tmp = -z
else if (y <= 1.4d+69) then
tmp = x + y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+79) {
tmp = -z;
} else if (y <= 1.4e+69) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.6e+79: tmp = -z elif y <= 1.4e+69: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.6e+79) tmp = Float64(-z); elseif (y <= 1.4e+69) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.6e+79) tmp = -z; elseif (y <= 1.4e+69) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.6e+79], (-z), If[LessEqual[y, 1.4e+69], N[(x + y), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+79}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+69}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -7.6000000000000005e79 or 1.39999999999999991e69 < y Initial program 51.3%
Taylor expanded in y around inf 81.5%
mul-1-neg81.5%
Simplified81.5%
if -7.6000000000000005e79 < y < 1.39999999999999991e69Initial program 99.4%
Taylor expanded in z around inf 75.8%
Final simplification77.6%
(FPCore (x y z) :precision binary64 (if (<= y -1.9e+79) (- z) (if (<= y 1.8e+19) x (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+79) {
tmp = -z;
} else if (y <= 1.8e+19) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.9d+79)) then
tmp = -z
else if (y <= 1.8d+19) then
tmp = x
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+79) {
tmp = -z;
} else if (y <= 1.8e+19) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e+79: tmp = -z elif y <= 1.8e+19: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e+79) tmp = Float64(-z); elseif (y <= 1.8e+19) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.9e+79) tmp = -z; elseif (y <= 1.8e+19) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e+79], (-z), If[LessEqual[y, 1.8e+19], x, (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+79}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+19}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -1.9000000000000001e79 or 1.8e19 < y Initial program 55.5%
Taylor expanded in y around inf 76.1%
mul-1-neg76.1%
Simplified76.1%
if -1.9000000000000001e79 < y < 1.8e19Initial program 100.0%
Taylor expanded in y around 0 60.8%
Final simplification66.3%
(FPCore (x y z) :precision binary64 (if (<= x -3.9e-200) x (if (<= x 3e-17) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.9e-200) {
tmp = x;
} else if (x <= 3e-17) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.9d-200)) then
tmp = x
else if (x <= 3d-17) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.9e-200) {
tmp = x;
} else if (x <= 3e-17) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.9e-200: tmp = x elif x <= 3e-17: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.9e-200) tmp = x; elseif (x <= 3e-17) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.9e-200) tmp = x; elseif (x <= 3e-17) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.9e-200], x, If[LessEqual[x, 3e-17], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-200}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-17}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.89999999999999999e-200 or 3.00000000000000006e-17 < x Initial program 83.2%
Taylor expanded in y around 0 54.2%
if -3.89999999999999999e-200 < x < 3.00000000000000006e-17Initial program 84.8%
Taylor expanded in x around 0 66.7%
Taylor expanded in y around 0 40.0%
Final simplification49.1%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 83.8%
Taylor expanded in y around 0 40.8%
Final simplification40.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ (+ y x) (- y)) z)))
(if (< y -3.7429310762689856e+171)
t_0
(if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y + x) / -y) * z
if (y < (-3.7429310762689856d+171)) then
tmp = t_0
else if (y < 3.5534662456086734d+168) then
tmp = (x + y) / (1.0d0 - (y / z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y + x) / -y) * z;
double tmp;
if (y < -3.7429310762689856e+171) {
tmp = t_0;
} else if (y < 3.5534662456086734e+168) {
tmp = (x + y) / (1.0 - (y / z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y + x) / -y) * z tmp = 0 if y < -3.7429310762689856e+171: tmp = t_0 elif y < 3.5534662456086734e+168: tmp = (x + y) / (1.0 - (y / z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z) tmp = 0.0 if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y + x) / -y) * z; tmp = 0.0; if (y < -3.7429310762689856e+171) tmp = t_0; elseif (y < 3.5534662456086734e+168) tmp = (x + y) / (1.0 - (y / z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023181
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:herbie-target
(if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1.0 (/ y z))))