
(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 -5e-242) (not (<= t_0 0.0))) t_0 (* z (/ (+ x y) (- y))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -5e-242) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((x + y) / -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 <= (-5d-242)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z * ((x + y) / -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 <= -5e-242) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * ((x + y) / -y);
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -5e-242) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * ((x + y) / -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 <= -5e-242) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(Float64(x + y) / Float64(-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 <= -5e-242) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * ((x + y) / -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, -5e-242], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-242} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{-y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -4.9999999999999998e-242 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.9%
if -4.9999999999999998e-242 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 5.2%
Taylor expanded in z around 0 99.6%
mul-1-neg99.6%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-neg-frac299.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= y -5e+147) (- z) (if (<= y 6.2e-7) (+ x y) (if (<= y 8e+197) (/ y (- 1.0 (/ y z))) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5e+147) {
tmp = -z;
} else if (y <= 6.2e-7) {
tmp = x + y;
} else if (y <= 8e+197) {
tmp = y / (1.0 - (y / z));
} 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 <= (-5d+147)) then
tmp = -z
else if (y <= 6.2d-7) then
tmp = x + y
else if (y <= 8d+197) then
tmp = y / (1.0d0 - (y / z))
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5e+147) {
tmp = -z;
} else if (y <= 6.2e-7) {
tmp = x + y;
} else if (y <= 8e+197) {
tmp = y / (1.0 - (y / z));
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5e+147: tmp = -z elif y <= 6.2e-7: tmp = x + y elif y <= 8e+197: tmp = y / (1.0 - (y / z)) else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5e+147) tmp = Float64(-z); elseif (y <= 6.2e-7) tmp = Float64(x + y); elseif (y <= 8e+197) tmp = Float64(y / Float64(1.0 - Float64(y / z))); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5e+147) tmp = -z; elseif (y <= 6.2e-7) tmp = x + y; elseif (y <= 8e+197) tmp = y / (1.0 - (y / z)); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5e+147], (-z), If[LessEqual[y, 6.2e-7], N[(x + y), $MachinePrecision], If[LessEqual[y, 8e+197], N[(y / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+147}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+197}:\\
\;\;\;\;\frac{y}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -5.0000000000000002e147 or 7.9999999999999996e197 < y Initial program 68.0%
Taylor expanded in y around inf 75.9%
mul-1-neg75.9%
Simplified75.9%
if -5.0000000000000002e147 < y < 6.1999999999999999e-7Initial program 96.8%
Taylor expanded in z around inf 74.1%
+-commutative74.1%
Simplified74.1%
if 6.1999999999999999e-7 < y < 7.9999999999999996e197Initial program 82.5%
Taylor expanded in x around 0 62.5%
Final simplification72.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.45e-90) (not (<= z 44000000000000.0))) (+ x y) (* z (/ (+ x y) (- y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.45e-90) || !(z <= 44000000000000.0)) {
tmp = x + y;
} else {
tmp = z * ((x + y) / -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 <= (-2.45d-90)) .or. (.not. (z <= 44000000000000.0d0))) then
tmp = x + y
else
tmp = z * ((x + y) / -y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.45e-90) || !(z <= 44000000000000.0)) {
tmp = x + y;
} else {
tmp = z * ((x + y) / -y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.45e-90) or not (z <= 44000000000000.0): tmp = x + y else: tmp = z * ((x + y) / -y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.45e-90) || !(z <= 44000000000000.0)) tmp = Float64(x + y); else tmp = Float64(z * Float64(Float64(x + y) / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.45e-90) || ~((z <= 44000000000000.0))) tmp = x + y; else tmp = z * ((x + y) / -y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.45e-90], N[Not[LessEqual[z, 44000000000000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{-90} \lor \neg \left(z \leq 44000000000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{-y}\\
\end{array}
\end{array}
if z < -2.44999999999999991e-90 or 4.4e13 < z Initial program 98.6%
Taylor expanded in z around inf 75.1%
+-commutative75.1%
Simplified75.1%
if -2.44999999999999991e-90 < z < 4.4e13Initial program 71.9%
Taylor expanded in z around 0 73.4%
mul-1-neg73.4%
associate-/l*76.0%
distribute-rgt-neg-in76.0%
distribute-neg-frac276.0%
+-commutative76.0%
Simplified76.0%
Final simplification75.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.2e-90) (not (<= z 50000000000000.0))) (+ x y) (- (- z) (/ (* x z) y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.2e-90) || !(z <= 50000000000000.0)) {
tmp = x + y;
} else {
tmp = -z - ((x * z) / 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 <= (-2.2d-90)) .or. (.not. (z <= 50000000000000.0d0))) then
tmp = x + y
else
tmp = -z - ((x * z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.2e-90) || !(z <= 50000000000000.0)) {
tmp = x + y;
} else {
tmp = -z - ((x * z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.2e-90) or not (z <= 50000000000000.0): tmp = x + y else: tmp = -z - ((x * z) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.2e-90) || !(z <= 50000000000000.0)) tmp = Float64(x + y); else tmp = Float64(Float64(-z) - Float64(Float64(x * z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.2e-90) || ~((z <= 50000000000000.0))) tmp = x + y; else tmp = -z - ((x * z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.2e-90], N[Not[LessEqual[z, 50000000000000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[((-z) - N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-90} \lor \neg \left(z \leq 50000000000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) - \frac{x \cdot z}{y}\\
\end{array}
\end{array}
if z < -2.19999999999999986e-90 or 5e13 < z Initial program 98.6%
Taylor expanded in z around inf 75.1%
+-commutative75.1%
Simplified75.1%
if -2.19999999999999986e-90 < z < 5e13Initial program 71.9%
Taylor expanded in z around 0 73.4%
Taylor expanded in x around 0 77.9%
Final simplification76.2%
(FPCore (x y z) :precision binary64 (if (<= y -6.5e+103) (- z) (if (<= y -6e-51) y (if (<= y 1.2e-6) x (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.5e+103) {
tmp = -z;
} else if (y <= -6e-51) {
tmp = y;
} else if (y <= 1.2e-6) {
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 <= (-6.5d+103)) then
tmp = -z
else if (y <= (-6d-51)) then
tmp = y
else if (y <= 1.2d-6) 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 <= -6.5e+103) {
tmp = -z;
} else if (y <= -6e-51) {
tmp = y;
} else if (y <= 1.2e-6) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.5e+103: tmp = -z elif y <= -6e-51: tmp = y elif y <= 1.2e-6: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.5e+103) tmp = Float64(-z); elseif (y <= -6e-51) tmp = y; elseif (y <= 1.2e-6) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.5e+103) tmp = -z; elseif (y <= -6e-51) tmp = y; elseif (y <= 1.2e-6) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.5e+103], (-z), If[LessEqual[y, -6e-51], y, If[LessEqual[y, 1.2e-6], x, (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+103}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-51}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -6.50000000000000001e103 or 1.1999999999999999e-6 < y Initial program 73.4%
Taylor expanded in y around inf 62.3%
mul-1-neg62.3%
Simplified62.3%
if -6.50000000000000001e103 < y < -6.00000000000000005e-51Initial program 93.5%
Taylor expanded in x around 0 58.9%
Taylor expanded in y around 0 40.3%
if -6.00000000000000005e-51 < y < 1.1999999999999999e-6Initial program 99.9%
Taylor expanded in y around 0 65.3%
Final simplification61.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.85e+148) (not (<= y 1.15e+79))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.85e+148) || !(y <= 1.15e+79)) {
tmp = -z;
} 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 ((y <= (-1.85d+148)) .or. (.not. (y <= 1.15d+79))) then
tmp = -z
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.85e+148) || !(y <= 1.15e+79)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.85e+148) or not (y <= 1.15e+79): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.85e+148) || !(y <= 1.15e+79)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.85e+148) || ~((y <= 1.15e+79))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.85e+148], N[Not[LessEqual[y, 1.15e+79]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+148} \lor \neg \left(y \leq 1.15 \cdot 10^{+79}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.8500000000000001e148 or 1.15e79 < y Initial program 70.1%
Taylor expanded in y around inf 71.1%
mul-1-neg71.1%
Simplified71.1%
if -1.8500000000000001e148 < y < 1.15e79Initial program 96.1%
Taylor expanded in z around inf 70.9%
+-commutative70.9%
Simplified70.9%
Final simplification71.0%
(FPCore (x y z) :precision binary64 (if (<= x -9.6e-56) x (if (<= x 3.8e-197) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.6e-56) {
tmp = x;
} else if (x <= 3.8e-197) {
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 <= (-9.6d-56)) then
tmp = x
else if (x <= 3.8d-197) 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 <= -9.6e-56) {
tmp = x;
} else if (x <= 3.8e-197) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.6e-56: tmp = x elif x <= 3.8e-197: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.6e-56) tmp = x; elseif (x <= 3.8e-197) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.6e-56) tmp = x; elseif (x <= 3.8e-197) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.6e-56], x, If[LessEqual[x, 3.8e-197], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{-56}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-197}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -9.60000000000000002e-56 or 3.7999999999999999e-197 < x Initial program 85.6%
Taylor expanded in y around 0 46.1%
if -9.60000000000000002e-56 < x < 3.7999999999999999e-197Initial program 92.6%
Taylor expanded in x around 0 82.0%
Taylor expanded in y around 0 44.2%
Final simplification45.6%
(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 87.7%
Taylor expanded in y around 0 35.8%
Final simplification35.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 2024043
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:alt
(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))))