
(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 9 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 (<= (/ (* x (- y z)) y) 5e+203) (- x (* x (/ z y))) (/ (- y z) (/ y x))))
double code(double x, double y, double z) {
double tmp;
if (((x * (y - z)) / y) <= 5e+203) {
tmp = x - (x * (z / y));
} else {
tmp = (y - z) / (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 * (y - z)) / y) <= 5d+203) then
tmp = x - (x * (z / y))
else
tmp = (y - z) / (y / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((x * (y - z)) / y) <= 5e+203) {
tmp = x - (x * (z / y));
} else {
tmp = (y - z) / (y / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * (y - z)) / y) <= 5e+203: tmp = x - (x * (z / y)) else: tmp = (y - z) / (y / x) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(x * Float64(y - z)) / y) <= 5e+203) tmp = Float64(x - Float64(x * Float64(z / y))); else tmp = Float64(Float64(y - z) / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((x * (y - z)) / y) <= 5e+203) tmp = x - (x * (z / y)); else tmp = (y - z) / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], 5e+203], N[(x - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq 5 \cdot 10^{+203}:\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) y) < 4.99999999999999994e203Initial program 85.7%
associate-*l/82.0%
Simplified82.0%
associate-/r/97.6%
Applied egg-rr97.6%
associate-/l*85.7%
*-commutative85.7%
associate-/l*81.0%
div-sub77.4%
associate-/r/94.7%
*-inverses94.7%
*-un-lft-identity94.7%
associate-/r/97.6%
Applied egg-rr97.6%
if 4.99999999999999994e203 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 69.5%
associate-*l/99.7%
Simplified99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= (/ (* x (- y z)) y) 5e+203) (- x (* x (/ z y))) (* (- y z) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (((x * (y - z)) / y) <= 5e+203) {
tmp = x - (x * (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 (((x * (y - z)) / y) <= 5d+203) then
tmp = x - (x * (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 (((x * (y - z)) / y) <= 5e+203) {
tmp = x - (x * (z / y));
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * (y - z)) / y) <= 5e+203: tmp = x - (x * (z / y)) else: tmp = (y - z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(Float64(x * Float64(y - z)) / y) <= 5e+203) tmp = Float64(x - Float64(x * Float64(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 (((x * (y - z)) / y) <= 5e+203) tmp = x - (x * (z / y)); else tmp = (y - z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], 5e+203], N[(x - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} \leq 5 \cdot 10^{+203}:\\
\;\;\;\;x - x \cdot \frac{z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) y) < 4.99999999999999994e203Initial program 85.7%
associate-*l/82.0%
Simplified82.0%
associate-/r/97.6%
Applied egg-rr97.6%
associate-/l*85.7%
*-commutative85.7%
associate-/l*81.0%
div-sub77.4%
associate-/r/94.7%
*-inverses94.7%
*-un-lft-identity94.7%
associate-/r/97.6%
Applied egg-rr97.6%
if 4.99999999999999994e203 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 69.5%
associate-*l/99.7%
Simplified99.7%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.7e-63) (not (<= z 6.1e-24))) (* z (/ (- x) y)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.7e-63) || !(z <= 6.1e-24)) {
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.7d-63)) .or. (.not. (z <= 6.1d-24))) 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.7e-63) || !(z <= 6.1e-24)) {
tmp = z * (-x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.7e-63) or not (z <= 6.1e-24): tmp = z * (-x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.7e-63) || !(z <= 6.1e-24)) 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.7e-63) || ~((z <= 6.1e-24))) tmp = z * (-x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.7e-63], N[Not[LessEqual[z, 6.1e-24]], $MachinePrecision]], N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-63} \lor \neg \left(z \leq 6.1 \cdot 10^{-24}\right):\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7000000000000002e-63 or 6.10000000000000036e-24 < z Initial program 89.0%
associate-*r/91.3%
div-sub91.3%
*-inverses91.3%
Simplified91.3%
Taylor expanded in z around inf 71.7%
mul-1-neg71.7%
*-commutative71.7%
associate-*r/73.6%
distribute-lft-neg-out73.6%
Simplified73.6%
if -2.7000000000000002e-63 < z < 6.10000000000000036e-24Initial program 75.6%
associate-*r/99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 76.6%
Final simplification75.1%
(FPCore (x y z) :precision binary64 (if (<= y -6.5e-49) x (if (<= y 3.8e-71) (* x (/ (- z) y)) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.5e-49) {
tmp = x;
} else if (y <= 3.8e-71) {
tmp = x * (-z / 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 (y <= (-6.5d-49)) then
tmp = x
else if (y <= 3.8d-71) then
tmp = x * (-z / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.5e-49) {
tmp = x;
} else if (y <= 3.8e-71) {
tmp = x * (-z / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.5e-49: tmp = x elif y <= 3.8e-71: tmp = x * (-z / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.5e-49) tmp = x; elseif (y <= 3.8e-71) tmp = Float64(x * Float64(Float64(-z) / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.5e-49) tmp = x; elseif (y <= 3.8e-71) tmp = x * (-z / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.5e-49], x, If[LessEqual[y, 3.8e-71], N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-71}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.49999999999999968e-49 or 3.79999999999999992e-71 < y Initial program 77.0%
associate-*r/99.2%
div-sub99.2%
*-inverses99.2%
Simplified99.2%
Taylor expanded in z around 0 76.7%
if -6.49999999999999968e-49 < y < 3.79999999999999992e-71Initial program 88.9%
associate-*r/91.1%
div-sub91.2%
*-inverses91.2%
Simplified91.2%
Taylor expanded in z around inf 74.2%
associate-*r/74.2%
mul-1-neg74.2%
distribute-rgt-neg-out74.2%
associate-*r/70.6%
Simplified70.6%
Final simplification73.9%
(FPCore (x y z) :precision binary64 (if (<= y -2.1e-48) x (if (<= y 2.7e-70) (/ z (/ (- y) x)) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.1e-48) {
tmp = x;
} else if (y <= 2.7e-70) {
tmp = z / (-y / x);
} 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 <= (-2.1d-48)) then
tmp = x
else if (y <= 2.7d-70) then
tmp = z / (-y / x)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.1e-48) {
tmp = x;
} else if (y <= 2.7e-70) {
tmp = z / (-y / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.1e-48: tmp = x elif y <= 2.7e-70: tmp = z / (-y / x) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.1e-48) tmp = x; elseif (y <= 2.7e-70) tmp = Float64(z / Float64(Float64(-y) / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.1e-48) tmp = x; elseif (y <= 2.7e-70) tmp = z / (-y / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.1e-48], x, If[LessEqual[y, 2.7e-70], N[(z / N[((-y) / x), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-48}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-70}:\\
\;\;\;\;\frac{z}{\frac{-y}{x}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.09999999999999989e-48 or 2.7000000000000001e-70 < y Initial program 77.0%
associate-*r/99.2%
div-sub99.2%
*-inverses99.2%
Simplified99.2%
Taylor expanded in z around 0 76.7%
if -2.09999999999999989e-48 < y < 2.7000000000000001e-70Initial program 88.9%
associate-*r/91.1%
div-sub91.2%
*-inverses91.2%
Simplified91.2%
Taylor expanded in z around inf 74.2%
mul-1-neg74.2%
*-commutative74.2%
associate-*r/75.9%
distribute-lft-neg-out75.9%
Simplified75.9%
clear-num75.8%
un-div-inv75.9%
add-sqr-sqrt41.2%
sqrt-unprod31.7%
sqr-neg31.7%
sqrt-unprod0.6%
add-sqr-sqrt1.6%
frac-2neg1.6%
add-sqr-sqrt1.0%
sqrt-unprod29.7%
sqr-neg29.7%
sqrt-unprod34.5%
add-sqr-sqrt75.9%
distribute-neg-frac75.9%
Applied egg-rr75.9%
Final simplification76.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.52e+212) (* (- y z) (/ x y)) (* x (- 1.0 (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.52e+212) {
tmp = (y - z) * (x / y);
} else {
tmp = x * (1.0 - (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 <= (-1.52d+212)) then
tmp = (y - z) * (x / y)
else
tmp = x * (1.0d0 - (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.52e+212) {
tmp = (y - z) * (x / y);
} else {
tmp = x * (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.52e+212: tmp = (y - z) * (x / y) else: tmp = x * (1.0 - (z / y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.52e+212) tmp = Float64(Float64(y - z) * Float64(x / y)); else tmp = Float64(x * Float64(1.0 - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.52e+212) tmp = (y - z) * (x / y); else tmp = x * (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.52e+212], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.52 \cdot 10^{+212}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{y}\right)\\
\end{array}
\end{array}
if z < -1.52000000000000006e212Initial program 90.4%
associate-*l/99.6%
Simplified99.6%
if -1.52000000000000006e212 < z Initial program 81.7%
associate-*r/97.1%
div-sub97.1%
*-inverses97.1%
Simplified97.1%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (<= x -5.5e+69) (* y (/ x y)) x))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e+69) {
tmp = y * (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 (x <= (-5.5d+69)) then
tmp = y * (x / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e+69) {
tmp = y * (x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.5e+69: tmp = y * (x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.5e+69) tmp = Float64(y * Float64(x / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.5e+69) tmp = y * (x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.5e+69], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+69}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.50000000000000002e69Initial program 71.1%
Taylor expanded in y around inf 31.5%
associate-/l*56.6%
associate-/r/65.9%
Applied egg-rr65.9%
if -5.50000000000000002e69 < x Initial program 85.1%
associate-*r/94.5%
div-sub94.5%
*-inverses94.5%
Simplified94.5%
Taylor expanded in z around 0 50.7%
Final simplification53.6%
(FPCore (x y z) :precision binary64 (* x (- 1.0 (/ z y))))
double code(double x, double y, double z) {
return x * (1.0 - (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 * (1.0d0 - (z / y))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (z / y));
}
def code(x, y, z): return x * (1.0 - (z / y))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(z / y))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (z / y)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \frac{z}{y}\right)
\end{array}
Initial program 82.4%
associate-*r/95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
Final simplification95.5%
(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 82.4%
associate-*r/95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in z around 0 51.8%
Final simplification51.8%
(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 2023310
(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))