
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
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 - z)) / y
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
def code(x, y, z): return (x * (y - z)) / y
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function tmp = code(x, y, z) tmp = (x * (y - z)) / y; end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
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 - z)) / y
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
def code(x, y, z): return (x * (y - z)) / y
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function tmp = code(x, y, z) tmp = (x * (y - z)) / y; end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{y}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -9.2e-148) (not (<= y 6e-13))) (* x (/ (- y z) y)) (* (- y z) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9.2e-148) || !(y <= 6e-13)) {
tmp = x * ((y - z) / y);
} else {
tmp = (y - z) * (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 <= (-9.2d-148)) .or. (.not. (y <= 6d-13))) then
tmp = x * ((y - z) / y)
else
tmp = (y - z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9.2e-148) || !(y <= 6e-13)) {
tmp = x * ((y - z) / y);
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9.2e-148) or not (y <= 6e-13): tmp = x * ((y - z) / y) else: tmp = (y - z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9.2e-148) || !(y <= 6e-13)) tmp = Float64(x * Float64(Float64(y - z) / y)); else tmp = Float64(Float64(y - z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9.2e-148) || ~((y <= 6e-13))) tmp = x * ((y - z) / y); else tmp = (y - z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.2e-148], N[Not[LessEqual[y, 6e-13]], $MachinePrecision]], N[(x * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-148} \lor \neg \left(y \leq 6 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -9.1999999999999999e-148 or 5.99999999999999968e-13 < y Initial program 81.4%
*-commutative81.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
if -9.1999999999999999e-148 < y < 5.99999999999999968e-13Initial program 94.0%
associate-*l/98.6%
Simplified98.6%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= (/ (* x (- y z)) y) -5e+145) (/ (- y z) (/ y x)) (/ x (/ y (- y z)))))
double code(double x, double y, double z) {
double tmp;
if (((x * (y - z)) / y) <= -5e+145) {
tmp = (y - z) / (y / x);
} else {
tmp = x / (y / (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 (((x * (y - z)) / y) <= (-5d+145)) then
tmp = (y - z) / (y / x)
else
tmp = x / (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((x * (y - z)) / y) <= -5e+145) {
tmp = (y - z) / (y / x);
} else {
tmp = x / (y / (y - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * (y - z)) / y) <= -5e+145: tmp = (y - z) / (y / x) else: tmp = x / (y / (y - z)) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(x * Float64(y - z)) / y) <= -5e+145) tmp = Float64(Float64(y - z) / Float64(y / x)); else tmp = Float64(x / Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((x * (y - z)) / y) <= -5e+145) tmp = (y - z) / (y / x); else tmp = x / (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], -5e+145], N[(N[(y - z), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq -5 \cdot 10^{+145}:\\
\;\;\;\;\frac{y - z}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) y) < -4.99999999999999967e145Initial program 69.1%
*-commutative69.1%
associate-*l/87.3%
*-commutative87.3%
Simplified87.3%
*-commutative87.3%
associate-*l/69.1%
associate-/l*98.0%
Applied egg-rr98.0%
if -4.99999999999999967e145 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 89.7%
*-commutative89.7%
associate-*l/98.5%
*-commutative98.5%
Simplified98.5%
associate-*r/89.7%
associate-/l*98.9%
Applied egg-rr98.9%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.6e-92) (not (<= z 0.014))) (* z (/ (- x) y)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.6e-92) || !(z <= 0.014)) {
tmp = z * (-x / 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 ((z <= (-2.6d-92)) .or. (.not. (z <= 0.014d0))) then
tmp = z * (-x / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.6e-92) || !(z <= 0.014)) {
tmp = z * (-x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.6e-92) or not (z <= 0.014): tmp = z * (-x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.6e-92) || !(z <= 0.014)) tmp = Float64(z * Float64(Float64(-x) / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.6e-92) || ~((z <= 0.014))) tmp = z * (-x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.6e-92], N[Not[LessEqual[z, 0.014]], $MachinePrecision]], N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-92} \lor \neg \left(z \leq 0.014\right):\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.6e-92 or 0.0140000000000000003 < z Initial program 89.6%
*-commutative89.6%
associate-*l/93.5%
*-commutative93.5%
Simplified93.5%
Taylor expanded in y around 0 72.1%
mul-1-neg72.1%
associate-*l/70.0%
distribute-rgt-neg-out70.0%
Simplified70.0%
if -2.6e-92 < z < 0.0140000000000000003Initial program 80.0%
*-commutative80.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 88.6%
Final simplification77.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.4e-84) (not (<= z 2.7e-5))) (/ (* z (- x)) y) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.4e-84) || !(z <= 2.7e-5)) {
tmp = (z * -x) / 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 ((z <= (-3.4d-84)) .or. (.not. (z <= 2.7d-5))) then
tmp = (z * -x) / y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.4e-84) || !(z <= 2.7e-5)) {
tmp = (z * -x) / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.4e-84) or not (z <= 2.7e-5): tmp = (z * -x) / y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.4e-84) || !(z <= 2.7e-5)) tmp = Float64(Float64(z * Float64(-x)) / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.4e-84) || ~((z <= 2.7e-5))) tmp = (z * -x) / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.4e-84], N[Not[LessEqual[z, 2.7e-5]], $MachinePrecision]], N[(N[(z * (-x)), $MachinePrecision] / y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-84} \lor \neg \left(z \leq 2.7 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.40000000000000021e-84 or 2.6999999999999999e-5 < z Initial program 90.1%
Taylor expanded in y around 0 73.0%
mul-1-neg73.0%
distribute-rgt-neg-out73.0%
Simplified73.0%
if -3.40000000000000021e-84 < z < 2.6999999999999999e-5Initial program 79.5%
*-commutative79.5%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 88.0%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (if (<= z -2.2e-92) (/ (- x) (/ y z)) (if (<= z 0.0027) x (* z (/ (- x) y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.2e-92) {
tmp = -x / (y / z);
} else if (z <= 0.0027) {
tmp = x;
} else {
tmp = z * (-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 <= (-2.2d-92)) then
tmp = -x / (y / z)
else if (z <= 0.0027d0) then
tmp = x
else
tmp = z * (-x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.2e-92) {
tmp = -x / (y / z);
} else if (z <= 0.0027) {
tmp = x;
} else {
tmp = z * (-x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.2e-92: tmp = -x / (y / z) elif z <= 0.0027: tmp = x else: tmp = z * (-x / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.2e-92) tmp = Float64(Float64(-x) / Float64(y / z)); elseif (z <= 0.0027) tmp = x; else tmp = Float64(z * Float64(Float64(-x) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.2e-92) tmp = -x / (y / z); elseif (z <= 0.0027) tmp = x; else tmp = z * (-x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.2e-92], N[((-x) / N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0027], x, N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{-x}{\frac{y}{z}}\\
\mathbf{elif}\;z \leq 0.0027:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\end{array}
\end{array}
if z < -2.19999999999999987e-92Initial program 89.3%
*-commutative89.3%
associate-*l/95.8%
*-commutative95.8%
Simplified95.8%
associate-*r/89.3%
associate-/l*97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 74.7%
mul-1-neg74.7%
associate-/l*74.0%
distribute-neg-frac74.0%
Simplified74.0%
if -2.19999999999999987e-92 < z < 0.0027000000000000001Initial program 80.0%
*-commutative80.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 88.6%
if 0.0027000000000000001 < z Initial program 90.1%
*-commutative90.1%
associate-*l/89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y around 0 68.0%
mul-1-neg68.0%
associate-*l/66.0%
distribute-rgt-neg-out66.0%
Simplified66.0%
Final simplification78.5%
(FPCore (x y z) :precision binary64 (if (<= x 120.0) x (* y (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= 120.0) {
tmp = x;
} else {
tmp = 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 (x <= 120.0d0) then
tmp = x
else
tmp = y * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 120.0) {
tmp = x;
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 120.0: tmp = x else: tmp = y * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 120.0) tmp = x; else tmp = Float64(y * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 120.0) tmp = x; else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 120.0], x, N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 120:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < 120Initial program 86.1%
*-commutative86.1%
associate-*l/94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in y around inf 53.9%
if 120 < x Initial program 83.9%
Taylor expanded in y around inf 35.6%
associate-/l*49.0%
associate-/r/60.8%
Applied egg-rr60.8%
Final simplification55.8%
(FPCore (x y z) :precision binary64 (if (<= x 1.3e+82) x (/ y (/ y x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.3e+82) {
tmp = x;
} else {
tmp = y / (y / 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.3d+82) then
tmp = x
else
tmp = y / (y / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.3e+82) {
tmp = x;
} else {
tmp = y / (y / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.3e+82: tmp = x else: tmp = y / (y / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.3e+82) tmp = x; else tmp = Float64(y / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.3e+82) tmp = x; else tmp = y / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.3e+82], x, N[(y / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < 1.2999999999999999e82Initial program 86.7%
*-commutative86.7%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in y around inf 55.2%
if 1.2999999999999999e82 < x Initial program 81.1%
Taylor expanded in y around inf 27.4%
associate-/l*42.9%
associate-/r/58.2%
Applied egg-rr58.2%
*-commutative58.2%
clear-num58.0%
div-inv58.2%
Applied egg-rr58.2%
Final simplification55.8%
(FPCore (x y z) :precision binary64 (* x (/ (- y z) y)))
double code(double x, double y, double z) {
return x * ((y - z) / y);
}
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 - z) / y)
end function
public static double code(double x, double y, double z) {
return x * ((y - z) / y);
}
def code(x, y, z): return x * ((y - z) / y)
function code(x, y, z) return Float64(x * Float64(Float64(y - z) / y)) end
function tmp = code(x, y, z) tmp = x * ((y - z) / y); end
code[x_, y_, z_] := N[(x * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{y}
\end{array}
Initial program 85.5%
*-commutative85.5%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
Final simplification96.3%
(FPCore (x y z) :precision binary64 (/ x (/ y (- y z))))
double code(double x, double y, double z) {
return x / (y / (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 / (y - z))
end function
public static double code(double x, double y, double z) {
return x / (y / (y - z));
}
def code(x, y, z): return x / (y / (y - z))
function code(x, y, z) return Float64(x / Float64(y / Float64(y - z))) end
function tmp = code(x, y, z) tmp = x / (y / (y - z)); end
code[x_, y_, z_] := N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{y}{y - z}}
\end{array}
Initial program 85.5%
*-commutative85.5%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
associate-*r/85.5%
associate-/l*96.8%
Applied egg-rr96.8%
Final simplification96.8%
(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 85.5%
*-commutative85.5%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in y around inf 52.5%
Final simplification52.5%
(FPCore (x y z) :precision binary64 (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (z < -2.060202331921739e+104) {
tmp = x - ((z * x) / y);
} else if (z < 1.6939766013828526e+213) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) * (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 < (-2.060202331921739d+104)) then
tmp = x - ((z * x) / y)
else if (z < 1.6939766013828526d+213) then
tmp = x / (y / (y - z))
else
tmp = (y - z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < -2.060202331921739e+104) {
tmp = x - ((z * x) / y);
} else if (z < 1.6939766013828526e+213) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < -2.060202331921739e+104: tmp = x - ((z * x) / y) elif z < 1.6939766013828526e+213: tmp = x / (y / (y - z)) else: tmp = (y - z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (z < -2.060202331921739e+104) tmp = Float64(x - Float64(Float64(z * x) / y)); elseif (z < 1.6939766013828526e+213) tmp = Float64(x / Float64(y / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < -2.060202331921739e+104) tmp = x - ((z * x) / y); elseif (z < 1.6939766013828526e+213) tmp = x / (y / (y - z)); else tmp = (y - z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, -2.060202331921739e+104], N[(x - N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[Less[z, 1.6939766013828526e+213], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\
\mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\end{array}
\end{array}
herbie shell --seed 2024010
(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))