
(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-210) (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 <= -2e-210) || !(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 <= (-2d-210)) .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 <= -2e-210) || !(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 <= -2e-210) 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 <= -2e-210) || !(t_0 <= 0.0)) tmp = t_0; else tmp = Float64(Float64(-z) / Float64(y / 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-210) || ~((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, -2e-210], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[((-z) / N[(y / 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^{-210} \lor \neg \left(t_0 \leq 0\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-z}{\frac{y}{x + y}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -2.0000000000000001e-210 or -0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) Initial program 99.9%
if -2.0000000000000001e-210 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -0.0Initial program 16.7%
Taylor expanded in z around 0 97.1%
mul-1-neg97.1%
associate-/l*100.0%
distribute-neg-frac100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -3.5e+83)
(+ x y)
(if (<= z -1.1e+71)
(/ y (- 1.0 (/ y z)))
(if (or (<= z -3.4e+18) (not (<= z 5.4e-65)))
(+ x y)
(/ (- z) (/ y (+ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e+83) {
tmp = x + y;
} else if (z <= -1.1e+71) {
tmp = y / (1.0 - (y / z));
} else if ((z <= -3.4e+18) || !(z <= 5.4e-65)) {
tmp = x + y;
} 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) :: tmp
if (z <= (-3.5d+83)) then
tmp = x + y
else if (z <= (-1.1d+71)) then
tmp = y / (1.0d0 - (y / z))
else if ((z <= (-3.4d+18)) .or. (.not. (z <= 5.4d-65))) then
tmp = x + y
else
tmp = -z / (y / (x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e+83) {
tmp = x + y;
} else if (z <= -1.1e+71) {
tmp = y / (1.0 - (y / z));
} else if ((z <= -3.4e+18) || !(z <= 5.4e-65)) {
tmp = x + y;
} else {
tmp = -z / (y / (x + y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.5e+83: tmp = x + y elif z <= -1.1e+71: tmp = y / (1.0 - (y / z)) elif (z <= -3.4e+18) or not (z <= 5.4e-65): tmp = x + y else: tmp = -z / (y / (x + y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.5e+83) tmp = Float64(x + y); elseif (z <= -1.1e+71) tmp = Float64(y / Float64(1.0 - Float64(y / z))); elseif ((z <= -3.4e+18) || !(z <= 5.4e-65)) tmp = Float64(x + y); else tmp = Float64(Float64(-z) / Float64(y / Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.5e+83) tmp = x + y; elseif (z <= -1.1e+71) tmp = y / (1.0 - (y / z)); elseif ((z <= -3.4e+18) || ~((z <= 5.4e-65))) tmp = x + y; else tmp = -z / (y / (x + y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.5e+83], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.1e+71], N[(y / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.4e+18], N[Not[LessEqual[z, 5.4e-65]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[((-z) / N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+83}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+71}:\\
\;\;\;\;\frac{y}{1 - \frac{y}{z}}\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{+18} \lor \neg \left(z \leq 5.4 \cdot 10^{-65}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{-z}{\frac{y}{x + y}}\\
\end{array}
\end{array}
if z < -3.49999999999999977e83 or -1.09999999999999997e71 < z < -3.4e18 or 5.3999999999999997e-65 < z Initial program 100.0%
Taylor expanded in z around inf 78.7%
+-commutative78.7%
Simplified78.7%
if -3.49999999999999977e83 < z < -1.09999999999999997e71Initial program 99.6%
Taylor expanded in x around 0 87.0%
if -3.4e18 < z < 5.3999999999999997e-65Initial program 75.7%
Taylor expanded in z around 0 76.4%
mul-1-neg76.4%
associate-/l*78.0%
distribute-neg-frac78.0%
+-commutative78.0%
Simplified78.0%
Final simplification78.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -8e+61) (not (<= y 63.0))) (- z) (/ x (- 1.0 (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+61) || !(y <= 63.0)) {
tmp = -z;
} else {
tmp = x / (1.0 - (y / 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 <= (-8d+61)) .or. (.not. (y <= 63.0d0))) then
tmp = -z
else
tmp = x / (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+61) || !(y <= 63.0)) {
tmp = -z;
} else {
tmp = x / (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -8e+61) or not (y <= 63.0): tmp = -z else: tmp = x / (1.0 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -8e+61) || !(y <= 63.0)) tmp = Float64(-z); else tmp = Float64(x / Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -8e+61) || ~((y <= 63.0))) tmp = -z; else tmp = x / (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -8e+61], N[Not[LessEqual[y, 63.0]], $MachinePrecision]], (-z), N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+61} \lor \neg \left(y \leq 63\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\end{array}
\end{array}
if y < -7.9999999999999996e61 or 63 < y Initial program 73.2%
Taylor expanded in y around inf 67.0%
mul-1-neg67.0%
Simplified67.0%
if -7.9999999999999996e61 < y < 63Initial program 99.2%
Taylor expanded in x around inf 69.6%
Final simplification68.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (/ y z)))) (if (or (<= x -8.2e-48) (not (<= x 2.5e-89))) (/ x t_0) (/ y t_0))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if ((x <= -8.2e-48) || !(x <= 2.5e-89)) {
tmp = x / t_0;
} else {
tmp = y / 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 = 1.0d0 - (y / z)
if ((x <= (-8.2d-48)) .or. (.not. (x <= 2.5d-89))) then
tmp = x / t_0
else
tmp = y / t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (y / z);
double tmp;
if ((x <= -8.2e-48) || !(x <= 2.5e-89)) {
tmp = x / t_0;
} else {
tmp = y / t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (y / z) tmp = 0 if (x <= -8.2e-48) or not (x <= 2.5e-89): tmp = x / t_0 else: tmp = y / t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(y / z)) tmp = 0.0 if ((x <= -8.2e-48) || !(x <= 2.5e-89)) tmp = Float64(x / t_0); else tmp = Float64(y / t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (y / z); tmp = 0.0; if ((x <= -8.2e-48) || ~((x <= 2.5e-89))) tmp = x / t_0; else tmp = y / t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -8.2e-48], N[Not[LessEqual[x, 2.5e-89]], $MachinePrecision]], N[(x / t$95$0), $MachinePrecision], N[(y / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{-48} \lor \neg \left(x \leq 2.5 \cdot 10^{-89}\right):\\
\;\;\;\;\frac{x}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t_0}\\
\end{array}
\end{array}
if x < -8.20000000000000028e-48 or 2.49999999999999983e-89 < x Initial program 88.1%
Taylor expanded in x around inf 69.7%
if -8.20000000000000028e-48 < x < 2.49999999999999983e-89Initial program 87.5%
Taylor expanded in x around 0 72.2%
Final simplification70.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -2e+88) (not (<= y 9.5e-11))) (- z) (+ x y)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2e+88) || !(y <= 9.5e-11)) {
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 <= (-2d+88)) .or. (.not. (y <= 9.5d-11))) 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 <= -2e+88) || !(y <= 9.5e-11)) {
tmp = -z;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2e+88) or not (y <= 9.5e-11): tmp = -z else: tmp = x + y return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2e+88) || !(y <= 9.5e-11)) tmp = Float64(-z); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2e+88) || ~((y <= 9.5e-11))) tmp = -z; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2e+88], N[Not[LessEqual[y, 9.5e-11]], $MachinePrecision]], (-z), N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+88} \lor \neg \left(y \leq 9.5 \cdot 10^{-11}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.99999999999999992e88 or 9.49999999999999951e-11 < y Initial program 72.3%
Taylor expanded in y around inf 70.2%
mul-1-neg70.2%
Simplified70.2%
if -1.99999999999999992e88 < y < 9.49999999999999951e-11Initial program 98.6%
Taylor expanded in z around inf 67.1%
+-commutative67.1%
Simplified67.1%
Final simplification68.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -9.6e-98) (not (<= y 1.1e-10))) (- z) x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9.6e-98) || !(y <= 1.1e-10)) {
tmp = -z;
} 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 ((y <= (-9.6d-98)) .or. (.not. (y <= 1.1d-10))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9.6e-98) || !(y <= 1.1e-10)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9.6e-98) or not (y <= 1.1e-10): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9.6e-98) || !(y <= 1.1e-10)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9.6e-98) || ~((y <= 1.1e-10))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.6e-98], N[Not[LessEqual[y, 1.1e-10]], $MachinePrecision]], (-z), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{-98} \lor \neg \left(y \leq 1.1 \cdot 10^{-10}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -9.60000000000000019e-98 or 1.09999999999999995e-10 < y Initial program 79.9%
Taylor expanded in y around inf 58.3%
mul-1-neg58.3%
Simplified58.3%
if -9.60000000000000019e-98 < y < 1.09999999999999995e-10Initial program 99.9%
Taylor expanded in y around 0 60.4%
Final simplification59.1%
(FPCore (x y z) :precision binary64 (if (<= x -1.45e-135) x (if (<= x 3.8e-142) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.45e-135) {
tmp = x;
} else if (x <= 3.8e-142) {
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 <= (-1.45d-135)) then
tmp = x
else if (x <= 3.8d-142) 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 <= -1.45e-135) {
tmp = x;
} else if (x <= 3.8e-142) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.45e-135: tmp = x elif x <= 3.8e-142: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.45e-135) tmp = x; elseif (x <= 3.8e-142) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.45e-135) tmp = x; elseif (x <= 3.8e-142) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.45e-135], x, If[LessEqual[x, 3.8e-142], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-135}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-142}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.4500000000000001e-135 or 3.79999999999999972e-142 < x Initial program 88.8%
Taylor expanded in y around 0 43.7%
if -1.4500000000000001e-135 < x < 3.79999999999999972e-142Initial program 85.8%
Taylor expanded in x around 0 78.2%
Taylor expanded in y around 0 35.6%
Final simplification41.0%
(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.8%
Taylor expanded in y around 0 32.1%
Final simplification32.1%
(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 2023312
(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))))