
(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 6 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}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (<= (/ (* x_m (- y z)) y) -5e+49)
(* (- y z) (/ x_m y))
(* x_m (/ (- y z) y)))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (((x_m * (y - z)) / y) <= -5e+49) {
tmp = (y - z) * (x_m / y);
} else {
tmp = x_m * ((y - z) / y);
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x_m * (y - z)) / y) <= (-5d+49)) then
tmp = (y - z) * (x_m / y)
else
tmp = x_m * ((y - z) / y)
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (((x_m * (y - z)) / y) <= -5e+49) {
tmp = (y - z) * (x_m / y);
} else {
tmp = x_m * ((y - z) / y);
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if ((x_m * (y - z)) / y) <= -5e+49: tmp = (y - z) * (x_m / y) else: tmp = x_m * ((y - z) / y) return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (Float64(Float64(x_m * Float64(y - z)) / y) <= -5e+49) tmp = Float64(Float64(y - z) * Float64(x_m / y)); else tmp = Float64(x_m * Float64(Float64(y - z) / y)); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (((x_m * (y - z)) / y) <= -5e+49) tmp = (y - z) * (x_m / y); else tmp = x_m * ((y - z) / y); end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], -5e+49], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{x\_m \cdot \left(y - z\right)}{y} \leq -5 \cdot 10^{+49}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{y}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) y) < -5.0000000000000004e49Initial program 73.2%
*-commutative73.2%
associate-/l*91.4%
Applied egg-rr91.4%
if -5.0000000000000004e49 < (/.f64 (*.f64 x (-.f64 y z)) y) Initial program 85.5%
associate-/l*98.3%
Simplified98.3%
Final simplification96.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (or (<= z -2600000000000.0) (not (<= z 1.15e+43)))
(/ z (/ y (- x_m)))
x_m)))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -2600000000000.0) || !(z <= 1.15e+43)) {
tmp = z / (y / -x_m);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2600000000000.0d0)) .or. (.not. (z <= 1.15d+43))) then
tmp = z / (y / -x_m)
else
tmp = x_m
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -2600000000000.0) || !(z <= 1.15e+43)) {
tmp = z / (y / -x_m);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (z <= -2600000000000.0) or not (z <= 1.15e+43): tmp = z / (y / -x_m) else: tmp = x_m return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((z <= -2600000000000.0) || !(z <= 1.15e+43)) tmp = Float64(z / Float64(y / Float64(-x_m))); else tmp = x_m; end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((z <= -2600000000000.0) || ~((z <= 1.15e+43))) tmp = z / (y / -x_m); else tmp = x_m; end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -2600000000000.0], N[Not[LessEqual[z, 1.15e+43]], $MachinePrecision]], N[(z / N[(y / (-x$95$m)), $MachinePrecision]), $MachinePrecision], x$95$m]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2600000000000 \lor \neg \left(z \leq 1.15 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{z}{\frac{y}{-x\_m}}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -2.6e12 or 1.1500000000000001e43 < z Initial program 85.2%
associate-/l*91.6%
Simplified91.6%
associate-*r/85.2%
clear-num85.1%
associate-/r*89.9%
Applied egg-rr89.9%
Taylor expanded in y around 0 71.6%
mul-1-neg71.6%
distribute-neg-frac271.6%
neg-mul-171.6%
*-commutative71.6%
*-commutative71.6%
associate-/l*75.1%
*-commutative75.1%
neg-mul-175.1%
Simplified75.1%
associate-*r/71.6%
distribute-frac-neg271.6%
add-sqr-sqrt39.5%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod0.8%
add-sqr-sqrt1.6%
associate-*r/1.8%
clear-num1.8%
un-div-inv1.8%
add-sqr-sqrt0.8%
sqrt-unprod35.5%
sqr-neg35.5%
sqrt-unprod41.1%
add-sqr-sqrt75.0%
Applied egg-rr75.0%
if -2.6e12 < z < 1.1500000000000001e43Initial program 79.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.8%
Final simplification78.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (or (<= z -8000000000000.0) (not (<= z 1.6e+43)))
(* z (/ x_m (- y)))
x_m)))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -8000000000000.0) || !(z <= 1.6e+43)) {
tmp = z * (x_m / -y);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-8000000000000.0d0)) .or. (.not. (z <= 1.6d+43))) then
tmp = z * (x_m / -y)
else
tmp = x_m
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if ((z <= -8000000000000.0) || !(z <= 1.6e+43)) {
tmp = z * (x_m / -y);
} else {
tmp = x_m;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if (z <= -8000000000000.0) or not (z <= 1.6e+43): tmp = z * (x_m / -y) else: tmp = x_m return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if ((z <= -8000000000000.0) || !(z <= 1.6e+43)) tmp = Float64(z * Float64(x_m / Float64(-y))); else tmp = x_m; end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if ((z <= -8000000000000.0) || ~((z <= 1.6e+43))) tmp = z * (x_m / -y); else tmp = x_m; end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[Or[LessEqual[z, -8000000000000.0], N[Not[LessEqual[z, 1.6e+43]], $MachinePrecision]], N[(z * N[(x$95$m / (-y)), $MachinePrecision]), $MachinePrecision], x$95$m]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8000000000000 \lor \neg \left(z \leq 1.6 \cdot 10^{+43}\right):\\
\;\;\;\;z \cdot \frac{x\_m}{-y}\\
\mathbf{else}:\\
\;\;\;\;x\_m\\
\end{array}
\end{array}
if z < -8e12 or 1.60000000000000007e43 < z Initial program 85.2%
associate-/l*91.6%
Simplified91.6%
associate-*r/85.2%
clear-num85.1%
associate-/r*89.9%
Applied egg-rr89.9%
Taylor expanded in y around 0 71.6%
mul-1-neg71.6%
distribute-neg-frac271.6%
neg-mul-171.6%
*-commutative71.6%
*-commutative71.6%
associate-/l*75.1%
*-commutative75.1%
neg-mul-175.1%
Simplified75.1%
if -8e12 < z < 1.60000000000000007e43Initial program 79.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.8%
Final simplification78.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
(FPCore (x_s x_m y z)
:precision binary64
(*
x_s
(if (<= z -470000000000.0)
(* z (/ x_m (- y)))
(if (<= z 2.7e+43) x_m (/ (* x_m (- z)) y)))))x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= -470000000000.0) {
tmp = z * (x_m / -y);
} else if (z <= 2.7e+43) {
tmp = x_m;
} else {
tmp = (x_m * -z) / y;
}
return x_s * tmp;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-470000000000.0d0)) then
tmp = z * (x_m / -y)
else if (z <= 2.7d+43) then
tmp = x_m
else
tmp = (x_m * -z) / y
end if
code = x_s * tmp
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
double tmp;
if (z <= -470000000000.0) {
tmp = z * (x_m / -y);
} else if (z <= 2.7e+43) {
tmp = x_m;
} else {
tmp = (x_m * -z) / y;
}
return x_s * tmp;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): tmp = 0 if z <= -470000000000.0: tmp = z * (x_m / -y) elif z <= 2.7e+43: tmp = x_m else: tmp = (x_m * -z) / y return x_s * tmp
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) tmp = 0.0 if (z <= -470000000000.0) tmp = Float64(z * Float64(x_m / Float64(-y))); elseif (z <= 2.7e+43) tmp = x_m; else tmp = Float64(Float64(x_m * Float64(-z)) / y); end return Float64(x_s * tmp) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m, y, z) tmp = 0.0; if (z <= -470000000000.0) tmp = z * (x_m / -y); elseif (z <= 2.7e+43) tmp = x_m; else tmp = (x_m * -z) / y; end tmp_2 = x_s * tmp; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * If[LessEqual[z, -470000000000.0], N[(z * N[(x$95$m / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+43], x$95$m, N[(N[(x$95$m * (-z)), $MachinePrecision] / y), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -470000000000:\\
\;\;\;\;z \cdot \frac{x\_m}{-y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+43}:\\
\;\;\;\;x\_m\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m \cdot \left(-z\right)}{y}\\
\end{array}
\end{array}
if z < -4.7e11Initial program 83.2%
associate-/l*89.3%
Simplified89.3%
associate-*r/83.2%
clear-num83.2%
associate-/r*87.8%
Applied egg-rr87.8%
Taylor expanded in y around 0 66.4%
mul-1-neg66.4%
distribute-neg-frac266.4%
neg-mul-166.4%
*-commutative66.4%
*-commutative66.4%
associate-/l*72.9%
*-commutative72.9%
neg-mul-172.9%
Simplified72.9%
if -4.7e11 < z < 2.7000000000000002e43Initial program 79.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 80.8%
if 2.7000000000000002e43 < z Initial program 87.5%
Taylor expanded in y around 0 78.0%
mul-1-neg78.0%
distribute-rgt-neg-out78.0%
Simplified78.0%
Final simplification78.3%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z) :precision binary64 (* x_s (* x_m (/ (- y z) y))))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
return x_s * (x_m * ((y - z) / y));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x_s * (x_m * ((y - z) / y))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
return x_s * (x_m * ((y - z) / y));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): return x_s * (x_m * ((y - z) / y))
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) return Float64(x_s * Float64(x_m * Float64(Float64(y - z) / y))) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z) tmp = x_s * (x_m * ((y - z) / y)); end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * N[(x$95$m * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(x\_m \cdot \frac{y - z}{y}\right)
\end{array}
Initial program 81.8%
associate-/l*96.2%
Simplified96.2%
Final simplification96.2%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) (FPCore (x_s x_m y z) :precision binary64 (* x_s x_m))
x_m = fabs(x);
x_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z) {
return x_s * x_m;
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x_s * x_m
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z) {
return x_s * x_m;
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) def code(x_s, x_m, y, z): return x_s * x_m
x_m = abs(x) x_s = copysign(1.0, x) function code(x_s, x_m, y, z) return Float64(x_s * x_m) end
x_m = abs(x); x_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m, y, z) tmp = x_s * x_m; end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot x\_m
\end{array}
Initial program 81.8%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around inf 54.9%
Final simplification54.9%
(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 2024044
(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))