
(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}
(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 81.3%
remove-double-neg81.3%
distribute-frac-neg281.3%
distribute-frac-neg81.3%
distribute-rgt-neg-in81.3%
associate-/l*96.2%
distribute-frac-neg96.2%
distribute-frac-neg296.2%
remove-double-neg96.2%
div-sub96.2%
*-inverses96.2%
Simplified96.2%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.6e+31)
(and (not (<= z -2.85e-6))
(or (<= z -1.15e-44) (not (<= z 1.05e-50)))))
(* z (- (/ x y)))
x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.6e+31) || (!(z <= -2.85e-6) && ((z <= -1.15e-44) || !(z <= 1.05e-50)))) {
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 <= (-5.6d+31)) .or. (.not. (z <= (-2.85d-6))) .and. (z <= (-1.15d-44)) .or. (.not. (z <= 1.05d-50))) 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 <= -5.6e+31) || (!(z <= -2.85e-6) && ((z <= -1.15e-44) || !(z <= 1.05e-50)))) {
tmp = z * -(x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.6e+31) or (not (z <= -2.85e-6) and ((z <= -1.15e-44) or not (z <= 1.05e-50))): tmp = z * -(x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.6e+31) || (!(z <= -2.85e-6) && ((z <= -1.15e-44) || !(z <= 1.05e-50)))) 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 <= -5.6e+31) || (~((z <= -2.85e-6)) && ((z <= -1.15e-44) || ~((z <= 1.05e-50))))) tmp = z * -(x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.6e+31], And[N[Not[LessEqual[z, -2.85e-6]], $MachinePrecision], Or[LessEqual[z, -1.15e-44], N[Not[LessEqual[z, 1.05e-50]], $MachinePrecision]]]], N[(z * (-N[(x / y), $MachinePrecision])), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+31} \lor \neg \left(z \leq -2.85 \cdot 10^{-6}\right) \land \left(z \leq -1.15 \cdot 10^{-44} \lor \neg \left(z \leq 1.05 \cdot 10^{-50}\right)\right):\\
\;\;\;\;z \cdot \left(-\frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.60000000000000034e31 or -2.8499999999999998e-6 < z < -1.14999999999999999e-44 or 1.05e-50 < z Initial program 88.4%
Taylor expanded in y around 0 75.6%
associate-*r*75.6%
*-commutative75.6%
mul-1-neg75.6%
Simplified75.6%
frac-2neg75.6%
distribute-frac-neg75.6%
add-sqr-sqrt42.8%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod0.6%
add-sqr-sqrt1.7%
remove-double-neg1.7%
distribute-rgt-neg-out1.7%
frac-2neg1.7%
div-inv1.7%
*-commutative1.7%
associate-*r*1.7%
associate-*l/1.7%
*-un-lft-identity1.7%
add-sqr-sqrt1.1%
sqrt-unprod24.0%
sqr-neg24.0%
sqrt-unprod29.6%
add-sqr-sqrt69.9%
associate-/r/74.1%
div-inv74.1%
clear-num74.1%
Applied egg-rr74.1%
if -5.60000000000000034e31 < z < -2.8499999999999998e-6 or -1.14999999999999999e-44 < z < 1.05e-50Initial program 73.8%
remove-double-neg73.8%
distribute-frac-neg273.8%
distribute-frac-neg73.8%
distribute-rgt-neg-in73.8%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 83.9%
Final simplification78.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (/ x y)))))
(if (<= z -8.4e+30)
t_0
(if (<= z -7.5e-7)
x
(if (<= z -9.5e-45) (/ (- z) (/ y x)) (if (<= z 6.4e-53) x t_0))))))
double code(double x, double y, double z) {
double t_0 = z * -(x / y);
double tmp;
if (z <= -8.4e+30) {
tmp = t_0;
} else if (z <= -7.5e-7) {
tmp = x;
} else if (z <= -9.5e-45) {
tmp = -z / (y / x);
} else if (z <= 6.4e-53) {
tmp = x;
} 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 = z * -(x / y)
if (z <= (-8.4d+30)) then
tmp = t_0
else if (z <= (-7.5d-7)) then
tmp = x
else if (z <= (-9.5d-45)) then
tmp = -z / (y / x)
else if (z <= 6.4d-53) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * -(x / y);
double tmp;
if (z <= -8.4e+30) {
tmp = t_0;
} else if (z <= -7.5e-7) {
tmp = x;
} else if (z <= -9.5e-45) {
tmp = -z / (y / x);
} else if (z <= 6.4e-53) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -(x / y) tmp = 0 if z <= -8.4e+30: tmp = t_0 elif z <= -7.5e-7: tmp = x elif z <= -9.5e-45: tmp = -z / (y / x) elif z <= 6.4e-53: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-Float64(x / y))) tmp = 0.0 if (z <= -8.4e+30) tmp = t_0; elseif (z <= -7.5e-7) tmp = x; elseif (z <= -9.5e-45) tmp = Float64(Float64(-z) / Float64(y / x)); elseif (z <= 6.4e-53) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -(x / y); tmp = 0.0; if (z <= -8.4e+30) tmp = t_0; elseif (z <= -7.5e-7) tmp = x; elseif (z <= -9.5e-45) tmp = -z / (y / x); elseif (z <= 6.4e-53) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[(x / y), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -8.4e+30], t$95$0, If[LessEqual[z, -7.5e-7], x, If[LessEqual[z, -9.5e-45], N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-53], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-\frac{x}{y}\right)\\
\mathbf{if}\;z \leq -8.4 \cdot 10^{+30}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{-z}{\frac{y}{x}}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.4000000000000001e30 or 6.4000000000000002e-53 < z Initial program 87.8%
Taylor expanded in y around 0 75.0%
associate-*r*75.0%
*-commutative75.0%
mul-1-neg75.0%
Simplified75.0%
frac-2neg75.0%
distribute-frac-neg75.0%
add-sqr-sqrt42.1%
sqrt-unprod27.7%
sqr-neg27.7%
sqrt-unprod0.6%
add-sqr-sqrt1.7%
remove-double-neg1.7%
distribute-rgt-neg-out1.7%
frac-2neg1.7%
div-inv1.7%
*-commutative1.7%
associate-*r*1.7%
associate-*l/1.7%
*-un-lft-identity1.7%
add-sqr-sqrt1.2%
sqrt-unprod23.7%
sqr-neg23.7%
sqrt-unprod29.7%
add-sqr-sqrt69.1%
associate-/r/73.4%
div-inv73.4%
clear-num73.4%
Applied egg-rr73.4%
if -8.4000000000000001e30 < z < -7.5000000000000002e-7 or -9.5000000000000002e-45 < z < 6.4000000000000002e-53Initial program 73.8%
remove-double-neg73.8%
distribute-frac-neg273.8%
distribute-frac-neg73.8%
distribute-rgt-neg-in73.8%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 83.9%
if -7.5000000000000002e-7 < z < -9.5000000000000002e-45Initial program 99.6%
clear-num99.3%
associate-/r/99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 85.1%
associate-*r*85.3%
*-commutative85.3%
mul-1-neg85.3%
Simplified85.1%
associate-*r*85.3%
associate-*l/85.5%
*-un-lft-identity85.5%
add-sqr-sqrt56.1%
sqrt-unprod29.7%
sqr-neg29.7%
sqrt-unprod0.8%
add-sqr-sqrt1.5%
associate-/r/1.5%
frac-2neg1.5%
distribute-neg-frac21.5%
add-sqr-sqrt0.7%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod28.9%
add-sqr-sqrt85.8%
Applied egg-rr85.8%
Final simplification78.8%
(FPCore (x y z)
:precision binary64
(if (<= z -3.3e+31)
(/ (* x (- z)) y)
(if (<= z -7e-8)
x
(if (<= z -5e-45)
(/ (- z) (/ y x))
(if (<= z 6.5e-53) x (* z (- (/ x y))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.3e+31) {
tmp = (x * -z) / y;
} else if (z <= -7e-8) {
tmp = x;
} else if (z <= -5e-45) {
tmp = -z / (y / x);
} else if (z <= 6.5e-53) {
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 <= (-3.3d+31)) then
tmp = (x * -z) / y
else if (z <= (-7d-8)) then
tmp = x
else if (z <= (-5d-45)) then
tmp = -z / (y / x)
else if (z <= 6.5d-53) 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 <= -3.3e+31) {
tmp = (x * -z) / y;
} else if (z <= -7e-8) {
tmp = x;
} else if (z <= -5e-45) {
tmp = -z / (y / x);
} else if (z <= 6.5e-53) {
tmp = x;
} else {
tmp = z * -(x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.3e+31: tmp = (x * -z) / y elif z <= -7e-8: tmp = x elif z <= -5e-45: tmp = -z / (y / x) elif z <= 6.5e-53: tmp = x else: tmp = z * -(x / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.3e+31) tmp = Float64(Float64(x * Float64(-z)) / y); elseif (z <= -7e-8) tmp = x; elseif (z <= -5e-45) tmp = Float64(Float64(-z) / Float64(y / x)); elseif (z <= 6.5e-53) 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 <= -3.3e+31) tmp = (x * -z) / y; elseif (z <= -7e-8) tmp = x; elseif (z <= -5e-45) tmp = -z / (y / x); elseif (z <= 6.5e-53) tmp = x; else tmp = z * -(x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.3e+31], N[(N[(x * (-z)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, -7e-8], x, If[LessEqual[z, -5e-45], N[((-z) / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-53], x, N[(z * (-N[(x / y), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+31}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{y}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-45}:\\
\;\;\;\;\frac{-z}{\frac{y}{x}}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-\frac{x}{y}\right)\\
\end{array}
\end{array}
if z < -3.29999999999999992e31Initial program 90.6%
Taylor expanded in y around 0 77.4%
associate-*r*77.4%
*-commutative77.4%
mul-1-neg77.4%
Simplified77.4%
if -3.29999999999999992e31 < z < -7.00000000000000048e-8 or -4.99999999999999976e-45 < z < 6.4999999999999997e-53Initial program 73.8%
remove-double-neg73.8%
distribute-frac-neg273.8%
distribute-frac-neg73.8%
distribute-rgt-neg-in73.8%
associate-/l*99.9%
distribute-frac-neg99.9%
distribute-frac-neg299.9%
remove-double-neg99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 83.9%
if -7.00000000000000048e-8 < z < -4.99999999999999976e-45Initial program 99.6%
clear-num99.3%
associate-/r/99.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 85.1%
associate-*r*85.3%
*-commutative85.3%
mul-1-neg85.3%
Simplified85.1%
associate-*r*85.3%
associate-*l/85.5%
*-un-lft-identity85.5%
add-sqr-sqrt56.1%
sqrt-unprod29.7%
sqr-neg29.7%
sqrt-unprod0.8%
add-sqr-sqrt1.5%
associate-/r/1.5%
frac-2neg1.5%
distribute-neg-frac21.5%
add-sqr-sqrt0.7%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod28.9%
add-sqr-sqrt85.8%
Applied egg-rr85.8%
if 6.4999999999999997e-53 < z Initial program 85.8%
Taylor expanded in y around 0 73.4%
associate-*r*73.4%
*-commutative73.4%
mul-1-neg73.4%
Simplified73.4%
frac-2neg73.4%
distribute-frac-neg73.4%
add-sqr-sqrt35.8%
sqrt-unprod21.1%
sqr-neg21.1%
sqrt-unprod0.4%
add-sqr-sqrt1.5%
remove-double-neg1.5%
distribute-rgt-neg-out1.5%
frac-2neg1.5%
div-inv1.5%
*-commutative1.5%
associate-*r*1.6%
associate-*l/1.6%
*-un-lft-identity1.6%
add-sqr-sqrt1.2%
sqrt-unprod30.4%
sqr-neg30.4%
sqrt-unprod34.9%
add-sqr-sqrt69.7%
associate-/r/74.6%
div-inv74.6%
clear-num74.6%
Applied egg-rr74.6%
Final simplification79.9%
(FPCore (x y z) :precision binary64 (if (<= x 2e+25) x (* y (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e+25) {
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 <= 2d+25) 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 <= 2e+25) {
tmp = x;
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2e+25: tmp = x else: tmp = y * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2e+25) 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 <= 2e+25) tmp = x; else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2e+25], x, N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < 2.00000000000000018e25Initial program 82.7%
remove-double-neg82.7%
distribute-frac-neg282.7%
distribute-frac-neg82.7%
distribute-rgt-neg-in82.7%
associate-/l*95.2%
distribute-frac-neg95.2%
distribute-frac-neg295.2%
remove-double-neg95.2%
div-sub95.2%
*-inverses95.2%
Simplified95.2%
Taylor expanded in z around 0 53.0%
if 2.00000000000000018e25 < x Initial program 76.1%
Taylor expanded in y around inf 28.4%
*-commutative28.4%
associate-/l*63.7%
Applied egg-rr63.7%
Final simplification55.3%
(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 81.3%
remove-double-neg81.3%
distribute-frac-neg281.3%
distribute-frac-neg81.3%
distribute-rgt-neg-in81.3%
associate-/l*96.2%
distribute-frac-neg96.2%
distribute-frac-neg296.2%
remove-double-neg96.2%
div-sub96.2%
*-inverses96.2%
Simplified96.2%
Taylor expanded in z around 0 52.9%
Final simplification52.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 2024059
(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))