
(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 -2.15e+50) (not (<= y 3.2e-92))) (* x (/ (- y z) y)) (* (- y z) (/ x y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.15e+50) || !(y <= 3.2e-92)) {
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 <= (-2.15d+50)) .or. (.not. (y <= 3.2d-92))) 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 <= -2.15e+50) || !(y <= 3.2e-92)) {
tmp = x * ((y - z) / y);
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.15e+50) or not (y <= 3.2e-92): tmp = x * ((y - z) / y) else: tmp = (y - z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.15e+50) || !(y <= 3.2e-92)) 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 <= -2.15e+50) || ~((y <= 3.2e-92))) tmp = x * ((y - z) / y); else tmp = (y - z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.15e+50], N[Not[LessEqual[y, 3.2e-92]], $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 -2.15 \cdot 10^{+50} \lor \neg \left(y \leq 3.2 \cdot 10^{-92}\right):\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < -2.1499999999999999e50 or 3.1999999999999997e-92 < y Initial program 78.3%
associate-/l*99.9%
Simplified99.9%
if -2.1499999999999999e50 < y < 3.1999999999999997e-92Initial program 90.9%
associate-/l*89.6%
Simplified89.6%
Taylor expanded in x around 0 90.9%
*-commutative90.9%
associate-*r/96.2%
Simplified96.2%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= (/ (* x (- y z)) y) 5e-68) (/ x (/ y (- y z))) (/ (- y z) (/ y x))))
double code(double x, double y, double z) {
double tmp;
if (((x * (y - z)) / y) <= 5e-68) {
tmp = x / (y / (y - z));
} 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-68) then
tmp = x / (y / (y - z))
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-68) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) / (y / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * (y - z)) / y) <= 5e-68: tmp = x / (y / (y - z)) 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-68) tmp = Float64(x / Float64(y / Float64(y - z))); 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-68) tmp = x / (y / (y - z)); 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-68], N[(x / N[(y / N[(y - z), $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^{-68}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) y) < 4.99999999999999971e-68Initial program 81.2%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in x around 0 81.2%
associate-*l/80.4%
associate-/r/96.7%
Simplified96.7%
if 4.99999999999999971e-68 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 91.3%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in x around 0 91.3%
*-commutative91.3%
associate-*r/96.5%
Simplified96.5%
clear-num96.4%
un-div-inv97.1%
Applied egg-rr97.1%
Final simplification96.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.25e-10) (not (<= z 3900000000.0))) (* (/ x y) (- z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.25e-10) || !(z <= 3900000000.0)) {
tmp = (x / y) * -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 ((z <= (-1.25d-10)) .or. (.not. (z <= 3900000000.0d0))) then
tmp = (x / y) * -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.25e-10) || !(z <= 3900000000.0)) {
tmp = (x / y) * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.25e-10) or not (z <= 3900000000.0): tmp = (x / y) * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.25e-10) || !(z <= 3900000000.0)) tmp = Float64(Float64(x / y) * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.25e-10) || ~((z <= 3900000000.0))) tmp = (x / y) * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.25e-10], N[Not[LessEqual[z, 3900000000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-10} \lor \neg \left(z \leq 3900000000\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.25000000000000008e-10 or 3.9e9 < z Initial program 92.0%
associate-/l*89.8%
Simplified89.8%
Taylor expanded in x around 0 92.0%
*-commutative92.0%
associate-*r/88.6%
Simplified88.6%
clear-num87.8%
un-div-inv87.9%
Applied egg-rr87.9%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
associate-*l/79.9%
distribute-rgt-neg-in79.9%
Simplified79.9%
if -1.25000000000000008e-10 < z < 3.9e9Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.9%
Final simplification80.3%
(FPCore (x y z) :precision binary64 (if (<= z -5.2e-10) (/ z (/ y (- x))) (if (<= z 2100000000.0) x (* (/ x y) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e-10) {
tmp = z / (y / -x);
} else if (z <= 2100000000.0) {
tmp = x;
} else {
tmp = (x / 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 (z <= (-5.2d-10)) then
tmp = z / (y / -x)
else if (z <= 2100000000.0d0) then
tmp = x
else
tmp = (x / y) * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e-10) {
tmp = z / (y / -x);
} else if (z <= 2100000000.0) {
tmp = x;
} else {
tmp = (x / y) * -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.2e-10: tmp = z / (y / -x) elif z <= 2100000000.0: tmp = x else: tmp = (x / y) * -z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.2e-10) tmp = Float64(z / Float64(y / Float64(-x))); elseif (z <= 2100000000.0) tmp = x; else tmp = Float64(Float64(x / y) * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.2e-10) tmp = z / (y / -x); elseif (z <= 2100000000.0) tmp = x; else tmp = (x / y) * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.2e-10], N[(z / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2100000000.0], x, N[(N[(x / y), $MachinePrecision] * (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{z}{\frac{y}{-x}}\\
\mathbf{elif}\;z \leq 2100000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-z\right)\\
\end{array}
\end{array}
if z < -5.19999999999999962e-10Initial program 94.7%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in y around 0 81.6%
mul-1-neg81.6%
associate-/l*73.8%
*-commutative73.8%
distribute-rgt-neg-in73.8%
Simplified73.8%
*-commutative73.8%
clear-num73.8%
un-div-inv75.3%
add-sqr-sqrt31.3%
sqrt-unprod28.2%
sqr-neg28.2%
sqrt-unprod1.0%
add-sqr-sqrt1.7%
Applied egg-rr1.7%
associate-/r/1.5%
Simplified1.5%
*-commutative1.5%
clear-num1.5%
div-inv1.5%
frac-2neg1.5%
distribute-neg-frac21.5%
add-sqr-sqrt0.8%
sqrt-unprod39.1%
sqr-neg39.1%
sqrt-unprod49.0%
add-sqr-sqrt81.4%
Applied egg-rr81.4%
if -5.19999999999999962e-10 < z < 2.1e9Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.9%
if 2.1e9 < z Initial program 88.7%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in x around 0 88.7%
*-commutative88.7%
associate-*r/90.4%
Simplified90.4%
clear-num88.8%
un-div-inv88.8%
Applied egg-rr88.8%
Taylor expanded in y around 0 76.0%
mul-1-neg76.0%
associate-*l/78.0%
distribute-rgt-neg-in78.0%
Simplified78.0%
Final simplification80.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.6e-11) (/ (* x (- z)) y) (if (<= z 33000000000.0) x (* (/ x y) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.6e-11) {
tmp = (x * -z) / y;
} else if (z <= 33000000000.0) {
tmp = x;
} else {
tmp = (x / 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 (z <= (-1.6d-11)) then
tmp = (x * -z) / y
else if (z <= 33000000000.0d0) then
tmp = x
else
tmp = (x / y) * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.6e-11) {
tmp = (x * -z) / y;
} else if (z <= 33000000000.0) {
tmp = x;
} else {
tmp = (x / y) * -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.6e-11: tmp = (x * -z) / y elif z <= 33000000000.0: tmp = x else: tmp = (x / y) * -z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.6e-11) tmp = Float64(Float64(x * Float64(-z)) / y); elseif (z <= 33000000000.0) tmp = x; else tmp = Float64(Float64(x / y) * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.6e-11) tmp = (x * -z) / y; elseif (z <= 33000000000.0) tmp = x; else tmp = (x / y) * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.6e-11], N[(N[(x * (-z)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 33000000000.0], x, N[(N[(x / y), $MachinePrecision] * (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-11}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\
\mathbf{elif}\;z \leq 33000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(-z\right)\\
\end{array}
\end{array}
if z < -1.59999999999999997e-11Initial program 94.7%
Taylor expanded in y around 0 81.6%
associate-*r*81.6%
*-commutative81.6%
mul-1-neg81.6%
Simplified81.6%
if -1.59999999999999997e-11 < z < 3.3e10Initial program 76.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.9%
if 3.3e10 < z Initial program 88.7%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in x around 0 88.7%
*-commutative88.7%
associate-*r/90.4%
Simplified90.4%
clear-num88.8%
un-div-inv88.8%
Applied egg-rr88.8%
Taylor expanded in y around 0 76.0%
mul-1-neg76.0%
associate-*l/78.0%
distribute-rgt-neg-in78.0%
Simplified78.0%
Final simplification80.4%
(FPCore (x y z) :precision binary64 (if (<= x 5e-212) (/ (* x (- y z)) y) (/ x (/ y (- y z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e-212) {
tmp = (x * (y - z)) / y;
} 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 <= 5d-212) then
tmp = (x * (y - z)) / y
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 <= 5e-212) {
tmp = (x * (y - z)) / y;
} else {
tmp = x / (y / (y - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e-212: tmp = (x * (y - z)) / y else: tmp = x / (y / (y - z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e-212) tmp = Float64(Float64(x * Float64(y - z)) / y); 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 <= 5e-212) tmp = (x * (y - z)) / y; else tmp = x / (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e-212], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{-212}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}
\end{array}
if x < 5.00000000000000043e-212Initial program 82.2%
if 5.00000000000000043e-212 < x Initial program 88.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 88.3%
associate-*l/90.3%
associate-/r/99.8%
Simplified99.8%
Final simplification89.4%
(FPCore (x y z) :precision binary64 (if (<= x 1e+84) x (* y (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e+84) {
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 <= 1d+84) 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 <= 1e+84) {
tmp = x;
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1e+84: tmp = x else: tmp = y * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1e+84) 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 <= 1e+84) tmp = x; else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1e+84], x, N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+84}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < 1.00000000000000006e84Initial program 84.9%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in y around inf 49.2%
if 1.00000000000000006e84 < x Initial program 83.6%
Taylor expanded in y around inf 36.9%
*-commutative36.9%
associate-/l*46.2%
Applied egg-rr46.2%
Final simplification48.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 84.7%
associate-/l*94.7%
Simplified94.7%
Final simplification94.7%
(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 84.7%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in x around 0 84.7%
associate-*l/85.9%
associate-/r/95.9%
Simplified95.9%
Final simplification95.9%
(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 84.7%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in y around inf 48.8%
Final simplification48.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 2024077
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:alt
(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))