
(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 -2e-281) (not (<= t_0 0.0))) t_0 (* z (- -1.0 (/ x y))))))
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -2e-281) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (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 <= (-2d-281)) .or. (.not. (t_0 <= 0.0d0))) then
tmp = t_0
else
tmp = z * ((-1.0d0) - (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 <= -2e-281) || !(t_0 <= 0.0)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z): t_0 = (x + y) / (1.0 - (y / z)) tmp = 0 if (t_0 <= -2e-281) or not (t_0 <= 0.0): tmp = t_0 else: tmp = z * (-1.0 - (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 <= -2e-281) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(z * Float64(-1.0 - Float64(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 <= -2e-281) || ~((t_0 <= 0.0))) tmp = t_0; else tmp = z * (-1.0 - (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, -2e-281], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{-281} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -2e-281 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.9%
if -2e-281 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0Initial program 6.9%
Taylor expanded in y around inf 99.9%
mul-1-neg99.9%
unsub-neg99.9%
mul-1-neg99.9%
associate-/l*99.9%
associate-/r/84.9%
unpow284.9%
associate-/l*84.9%
Simplified84.9%
Taylor expanded in z around 0 100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z (- (- x) y)) y)))
(if (<= y -4.6e-37)
t_0
(if (<= y 4.4e-73) (+ x y) (if (<= y 1.22e+172) t_0 (- z))))))
double code(double x, double y, double z) {
double t_0 = (z * (-x - y)) / y;
double tmp;
if (y <= -4.6e-37) {
tmp = t_0;
} else if (y <= 4.4e-73) {
tmp = x + y;
} else if (y <= 1.22e+172) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (z * (-x - y)) / y
if (y <= (-4.6d-37)) then
tmp = t_0
else if (y <= 4.4d-73) then
tmp = x + y
else if (y <= 1.22d+172) then
tmp = t_0
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (-x - y)) / y;
double tmp;
if (y <= -4.6e-37) {
tmp = t_0;
} else if (y <= 4.4e-73) {
tmp = x + y;
} else if (y <= 1.22e+172) {
tmp = t_0;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): t_0 = (z * (-x - y)) / y tmp = 0 if y <= -4.6e-37: tmp = t_0 elif y <= 4.4e-73: tmp = x + y elif y <= 1.22e+172: tmp = t_0 else: tmp = -z return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(Float64(-x) - y)) / y) tmp = 0.0 if (y <= -4.6e-37) tmp = t_0; elseif (y <= 4.4e-73) tmp = Float64(x + y); elseif (y <= 1.22e+172) tmp = t_0; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (-x - y)) / y; tmp = 0.0; if (y <= -4.6e-37) tmp = t_0; elseif (y <= 4.4e-73) tmp = x + y; elseif (y <= 1.22e+172) tmp = t_0; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[((-x) - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -4.6e-37], t$95$0, If[LessEqual[y, 4.4e-73], N[(x + y), $MachinePrecision], If[LessEqual[y, 1.22e+172], t$95$0, (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot \left(\left(-x\right) - y\right)}{y}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-73}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+172}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4.5999999999999999e-37 or 4.4e-73 < y < 1.21999999999999999e172Initial program 79.5%
Taylor expanded in z around 0 68.8%
associate-*r/68.8%
+-commutative68.8%
*-commutative68.8%
associate-*r*68.8%
mul-1-neg68.8%
+-commutative68.8%
Simplified68.8%
if -4.5999999999999999e-37 < y < 4.4e-73Initial program 100.0%
Taylor expanded in z around inf 85.9%
if 1.21999999999999999e172 < y Initial program 62.9%
Taylor expanded in y around inf 75.5%
mul-1-neg75.5%
Simplified75.5%
Final simplification76.7%
(FPCore (x y z)
:precision binary64
(if (<= y -2.6e+14)
(- z)
(if (<= y 1.44e-95)
(+ x y)
(if (<= y 2.2e+101) (/ x (- 1.0 (/ y z))) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.6e+14) {
tmp = -z;
} else if (y <= 1.44e-95) {
tmp = x + y;
} else if (y <= 2.2e+101) {
tmp = x / (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 <= (-2.6d+14)) then
tmp = -z
else if (y <= 1.44d-95) then
tmp = x + y
else if (y <= 2.2d+101) then
tmp = x / (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 <= -2.6e+14) {
tmp = -z;
} else if (y <= 1.44e-95) {
tmp = x + y;
} else if (y <= 2.2e+101) {
tmp = x / (1.0 - (y / z));
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.6e+14: tmp = -z elif y <= 1.44e-95: tmp = x + y elif y <= 2.2e+101: tmp = x / (1.0 - (y / z)) else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.6e+14) tmp = Float64(-z); elseif (y <= 1.44e-95) tmp = Float64(x + y); elseif (y <= 2.2e+101) tmp = Float64(x / 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 <= -2.6e+14) tmp = -z; elseif (y <= 1.44e-95) tmp = x + y; elseif (y <= 2.2e+101) tmp = x / (1.0 - (y / z)); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.6e+14], (-z), If[LessEqual[y, 1.44e-95], N[(x + y), $MachinePrecision], If[LessEqual[y, 2.2e+101], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+14}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.44 \cdot 10^{-95}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -2.6e14 or 2.2000000000000001e101 < y Initial program 67.7%
Taylor expanded in y around inf 66.0%
mul-1-neg66.0%
Simplified66.0%
if -2.6e14 < y < 1.44000000000000003e-95Initial program 99.9%
Taylor expanded in z around inf 82.0%
if 1.44000000000000003e-95 < y < 2.2000000000000001e101Initial program 95.1%
Taylor expanded in x around inf 55.4%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.7e-42) (not (<= y 3.6e-73))) (* z (- -1.0 (/ x y))) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.7e-42) || !(y <= 3.6e-73)) {
tmp = z * (-1.0 - (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 ((y <= (-4.7d-42)) .or. (.not. (y <= 3.6d-73))) then
tmp = z * ((-1.0d0) - (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 ((y <= -4.7e-42) || !(y <= 3.6e-73)) {
tmp = z * (-1.0 - (x / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.7e-42) or not (y <= 3.6e-73): tmp = z * (-1.0 - (x / y)) else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.7e-42) || !(y <= 3.6e-73)) tmp = Float64(z * Float64(-1.0 - Float64(x / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.7e-42) || ~((y <= 3.6e-73))) tmp = z * (-1.0 - (x / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.7e-42], N[Not[LessEqual[y, 3.6e-73]], $MachinePrecision]], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{-42} \lor \neg \left(y \leq 3.6 \cdot 10^{-73}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -4.7000000000000001e-42 or 3.5999999999999999e-73 < y Initial program 76.9%
Taylor expanded in y around inf 71.3%
mul-1-neg71.3%
unsub-neg71.3%
mul-1-neg71.3%
associate-/l*73.0%
associate-/r/70.2%
unpow270.2%
associate-/l*71.8%
Simplified71.8%
Taylor expanded in z around 0 74.6%
if -4.7000000000000001e-42 < y < 3.5999999999999999e-73Initial program 100.0%
Taylor expanded in z around inf 85.9%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (if (<= y -68000000000000.0) (- z) (if (<= y 1.04e+102) (+ x y) (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -68000000000000.0) {
tmp = -z;
} else if (y <= 1.04e+102) {
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 <= (-68000000000000.0d0)) then
tmp = -z
else if (y <= 1.04d+102) 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 <= -68000000000000.0) {
tmp = -z;
} else if (y <= 1.04e+102) {
tmp = x + y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -68000000000000.0: tmp = -z elif y <= 1.04e+102: tmp = x + y else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -68000000000000.0) tmp = Float64(-z); elseif (y <= 1.04e+102) tmp = Float64(x + y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -68000000000000.0) tmp = -z; elseif (y <= 1.04e+102) tmp = x + y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -68000000000000.0], (-z), If[LessEqual[y, 1.04e+102], N[(x + y), $MachinePrecision], (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -68000000000000:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.04 \cdot 10^{+102}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -6.8e13 or 1.04e102 < y Initial program 67.3%
Taylor expanded in y around inf 66.6%
mul-1-neg66.6%
Simplified66.6%
if -6.8e13 < y < 1.04e102Initial program 98.7%
Taylor expanded in z around inf 70.9%
Final simplification69.3%
(FPCore (x y z) :precision binary64 (if (<= y -40000000000000.0) (- z) (if (<= y 3e-66) x (- z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -40000000000000.0) {
tmp = -z;
} else if (y <= 3e-66) {
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 <= (-40000000000000.0d0)) then
tmp = -z
else if (y <= 3d-66) 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 <= -40000000000000.0) {
tmp = -z;
} else if (y <= 3e-66) {
tmp = x;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -40000000000000.0: tmp = -z elif y <= 3e-66: tmp = x else: tmp = -z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -40000000000000.0) tmp = Float64(-z); elseif (y <= 3e-66) tmp = x; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -40000000000000.0) tmp = -z; elseif (y <= 3e-66) tmp = x; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -40000000000000.0], (-z), If[LessEqual[y, 3e-66], x, (-z)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -40000000000000:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-66}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -4e13 or 3.0000000000000002e-66 < y Initial program 74.5%
Taylor expanded in y around inf 56.5%
mul-1-neg56.5%
Simplified56.5%
if -4e13 < y < 3.0000000000000002e-66Initial program 99.9%
Taylor expanded in y around 0 65.1%
Final simplification60.7%
(FPCore (x y z) :precision binary64 (if (<= x -6.4e-257) x (if (<= x 3.8e-175) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.4e-257) {
tmp = x;
} else if (x <= 3.8e-175) {
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 <= (-6.4d-257)) then
tmp = x
else if (x <= 3.8d-175) 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 <= -6.4e-257) {
tmp = x;
} else if (x <= 3.8e-175) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.4e-257: tmp = x elif x <= 3.8e-175: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.4e-257) tmp = x; elseif (x <= 3.8e-175) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.4e-257) tmp = x; elseif (x <= 3.8e-175) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.4e-257], x, If[LessEqual[x, 3.8e-175], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.4 \cdot 10^{-257}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-175}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.39999999999999971e-257 or 3.8e-175 < x Initial program 87.4%
Taylor expanded in y around 0 43.1%
if -6.39999999999999971e-257 < x < 3.8e-175Initial program 83.8%
Taylor expanded in x around 0 71.4%
Taylor expanded in y around 0 38.5%
Final simplification42.4%
(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 86.8%
Taylor expanded in y around 0 38.3%
Final simplification38.3%
(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 2023182
(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))))