
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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 - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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 - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- y z) 1.0)))
(if (<= z -1.08e+29)
(* x (+ (/ y z) -1.0))
(if (<= z 4.5e-142) (* t_0 (/ x z)) (/ x (/ z t_0))))))
double code(double x, double y, double z) {
double t_0 = (y - z) + 1.0;
double tmp;
if (z <= -1.08e+29) {
tmp = x * ((y / z) + -1.0);
} else if (z <= 4.5e-142) {
tmp = t_0 * (x / z);
} else {
tmp = x / (z / 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 = (y - z) + 1.0d0
if (z <= (-1.08d+29)) then
tmp = x * ((y / z) + (-1.0d0))
else if (z <= 4.5d-142) then
tmp = t_0 * (x / z)
else
tmp = x / (z / t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y - z) + 1.0;
double tmp;
if (z <= -1.08e+29) {
tmp = x * ((y / z) + -1.0);
} else if (z <= 4.5e-142) {
tmp = t_0 * (x / z);
} else {
tmp = x / (z / t_0);
}
return tmp;
}
def code(x, y, z): t_0 = (y - z) + 1.0 tmp = 0 if z <= -1.08e+29: tmp = x * ((y / z) + -1.0) elif z <= 4.5e-142: tmp = t_0 * (x / z) else: tmp = x / (z / t_0) return tmp
function code(x, y, z) t_0 = Float64(Float64(y - z) + 1.0) tmp = 0.0 if (z <= -1.08e+29) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); elseif (z <= 4.5e-142) tmp = Float64(t_0 * Float64(x / z)); else tmp = Float64(x / Float64(z / t_0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - z) + 1.0; tmp = 0.0; if (z <= -1.08e+29) tmp = x * ((y / z) + -1.0); elseif (z <= 4.5e-142) tmp = t_0 * (x / z); else tmp = x / (z / t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[z, -1.08e+29], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-142], N[(t$95$0 * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - z\right) + 1\\
\mathbf{if}\;z \leq -1.08 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-142}:\\
\;\;\;\;t\_0 \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t\_0}}\\
\end{array}
\end{array}
if z < -1.0800000000000001e29Initial program 73.9%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -1.0800000000000001e29 < z < 4.50000000000000019e-142Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
if 4.50000000000000019e-142 < z Initial program 78.4%
associate-/l*99.7%
Simplified99.7%
clear-num99.7%
un-div-inv99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -1.36e+44)
(- x)
(if (<= z -8.5e-13)
t_0
(if (<= z -4.3e-64)
(/ x z)
(if (<= z -1.9e-234)
t_0
(if (<= z 0.0019) (/ x z) (if (<= z 3.3e+86) t_0 (- x)))))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -1.36e+44) {
tmp = -x;
} else if (z <= -8.5e-13) {
tmp = t_0;
} else if (z <= -4.3e-64) {
tmp = x / z;
} else if (z <= -1.9e-234) {
tmp = t_0;
} else if (z <= 0.0019) {
tmp = x / z;
} else if (z <= 3.3e+86) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x * (y / z)
if (z <= (-1.36d+44)) then
tmp = -x
else if (z <= (-8.5d-13)) then
tmp = t_0
else if (z <= (-4.3d-64)) then
tmp = x / z
else if (z <= (-1.9d-234)) then
tmp = t_0
else if (z <= 0.0019d0) then
tmp = x / z
else if (z <= 3.3d+86) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -1.36e+44) {
tmp = -x;
} else if (z <= -8.5e-13) {
tmp = t_0;
} else if (z <= -4.3e-64) {
tmp = x / z;
} else if (z <= -1.9e-234) {
tmp = t_0;
} else if (z <= 0.0019) {
tmp = x / z;
} else if (z <= 3.3e+86) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -1.36e+44: tmp = -x elif z <= -8.5e-13: tmp = t_0 elif z <= -4.3e-64: tmp = x / z elif z <= -1.9e-234: tmp = t_0 elif z <= 0.0019: tmp = x / z elif z <= 3.3e+86: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y / z)) tmp = 0.0 if (z <= -1.36e+44) tmp = Float64(-x); elseif (z <= -8.5e-13) tmp = t_0; elseif (z <= -4.3e-64) tmp = Float64(x / z); elseif (z <= -1.9e-234) tmp = t_0; elseif (z <= 0.0019) tmp = Float64(x / z); elseif (z <= 3.3e+86) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y / z); tmp = 0.0; if (z <= -1.36e+44) tmp = -x; elseif (z <= -8.5e-13) tmp = t_0; elseif (z <= -4.3e-64) tmp = x / z; elseif (z <= -1.9e-234) tmp = t_0; elseif (z <= 0.0019) tmp = x / z; elseif (z <= 3.3e+86) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.36e+44], (-x), If[LessEqual[z, -8.5e-13], t$95$0, If[LessEqual[z, -4.3e-64], N[(x / z), $MachinePrecision], If[LessEqual[z, -1.9e-234], t$95$0, If[LessEqual[z, 0.0019], N[(x / z), $MachinePrecision], If[LessEqual[z, 3.3e+86], t$95$0, (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -1.36 \cdot 10^{+44}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-234}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.0019:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.36000000000000005e44 or 3.2999999999999999e86 < z Initial program 68.9%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 81.0%
neg-mul-181.0%
Simplified81.0%
if -1.36000000000000005e44 < z < -8.5000000000000001e-13 or -4.29999999999999973e-64 < z < -1.89999999999999992e-234 or 0.0019 < z < 3.2999999999999999e86Initial program 96.2%
associate-/l*95.9%
+-commutative95.9%
associate-+r-95.9%
div-sub95.9%
*-inverses95.9%
sub-neg95.9%
metadata-eval95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in y around inf 67.1%
associate-/l*66.9%
Simplified66.9%
if -8.5000000000000001e-13 < z < -4.29999999999999973e-64 or -1.89999999999999992e-234 < z < 0.0019Initial program 99.9%
associate-/l*89.1%
+-commutative89.1%
associate-+r-89.1%
div-sub89.1%
*-inverses89.1%
sub-neg89.1%
metadata-eval89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in y around 0 68.6%
sub-neg68.6%
metadata-eval68.6%
distribute-rgt-in68.6%
associate-*l/68.8%
*-lft-identity68.8%
neg-mul-168.8%
unsub-neg68.8%
Simplified68.8%
Taylor expanded in z around 0 67.6%
Final simplification72.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -6.2e+43)
(- x)
(if (<= z -6.2e-13)
t_0
(if (<= z -3.5e-66)
(/ x z)
(if (<= z 1.18e-135)
(* y (/ x z))
(if (<= z 0.0019) (/ x z) (if (<= z 2.45e+86) t_0 (- x)))))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -6.2e+43) {
tmp = -x;
} else if (z <= -6.2e-13) {
tmp = t_0;
} else if (z <= -3.5e-66) {
tmp = x / z;
} else if (z <= 1.18e-135) {
tmp = y * (x / z);
} else if (z <= 0.0019) {
tmp = x / z;
} else if (z <= 2.45e+86) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x * (y / z)
if (z <= (-6.2d+43)) then
tmp = -x
else if (z <= (-6.2d-13)) then
tmp = t_0
else if (z <= (-3.5d-66)) then
tmp = x / z
else if (z <= 1.18d-135) then
tmp = y * (x / z)
else if (z <= 0.0019d0) then
tmp = x / z
else if (z <= 2.45d+86) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -6.2e+43) {
tmp = -x;
} else if (z <= -6.2e-13) {
tmp = t_0;
} else if (z <= -3.5e-66) {
tmp = x / z;
} else if (z <= 1.18e-135) {
tmp = y * (x / z);
} else if (z <= 0.0019) {
tmp = x / z;
} else if (z <= 2.45e+86) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -6.2e+43: tmp = -x elif z <= -6.2e-13: tmp = t_0 elif z <= -3.5e-66: tmp = x / z elif z <= 1.18e-135: tmp = y * (x / z) elif z <= 0.0019: tmp = x / z elif z <= 2.45e+86: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y / z)) tmp = 0.0 if (z <= -6.2e+43) tmp = Float64(-x); elseif (z <= -6.2e-13) tmp = t_0; elseif (z <= -3.5e-66) tmp = Float64(x / z); elseif (z <= 1.18e-135) tmp = Float64(y * Float64(x / z)); elseif (z <= 0.0019) tmp = Float64(x / z); elseif (z <= 2.45e+86) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y / z); tmp = 0.0; if (z <= -6.2e+43) tmp = -x; elseif (z <= -6.2e-13) tmp = t_0; elseif (z <= -3.5e-66) tmp = x / z; elseif (z <= 1.18e-135) tmp = y * (x / z); elseif (z <= 0.0019) tmp = x / z; elseif (z <= 2.45e+86) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+43], (-x), If[LessEqual[z, -6.2e-13], t$95$0, If[LessEqual[z, -3.5e-66], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.18e-135], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0019], N[(x / z), $MachinePrecision], If[LessEqual[z, 2.45e+86], t$95$0, (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+43}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-135}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 0.0019:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+86}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -6.2000000000000003e43 or 2.45e86 < z Initial program 68.9%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 81.0%
neg-mul-181.0%
Simplified81.0%
if -6.2000000000000003e43 < z < -6.1999999999999998e-13 or 0.0019 < z < 2.45e86Initial program 90.2%
associate-/l*99.4%
+-commutative99.4%
associate-+r-99.4%
div-sub99.4%
*-inverses99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 60.5%
associate-/l*69.8%
Simplified69.8%
if -6.1999999999999998e-13 < z < -3.5e-66 or 1.18000000000000003e-135 < z < 0.0019Initial program 99.9%
associate-/l*99.7%
+-commutative99.7%
associate-+r-99.7%
div-sub99.6%
*-inverses99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around 0 88.4%
sub-neg88.4%
metadata-eval88.4%
distribute-rgt-in88.5%
associate-*l/88.8%
*-lft-identity88.8%
neg-mul-188.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in z around 0 85.8%
if -3.5e-66 < z < 1.18000000000000003e-135Initial program 99.8%
associate-/l*87.7%
Simplified87.7%
clear-num87.6%
un-div-inv87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in y around inf 56.7%
associate-/r/69.8%
Applied egg-rr69.8%
Final simplification76.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -8.6e-17) (not (<= z 3.6e-84))) (* x (+ -1.0 (/ (+ y 1.0) z))) (* (/ x z) (+ y 1.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.6e-17) || !(z <= 3.6e-84)) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else {
tmp = (x / z) * (y + 1.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) :: tmp
if ((z <= (-8.6d-17)) .or. (.not. (z <= 3.6d-84))) then
tmp = x * ((-1.0d0) + ((y + 1.0d0) / z))
else
tmp = (x / z) * (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -8.6e-17) || !(z <= 3.6e-84)) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else {
tmp = (x / z) * (y + 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.6e-17) or not (z <= 3.6e-84): tmp = x * (-1.0 + ((y + 1.0) / z)) else: tmp = (x / z) * (y + 1.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.6e-17) || !(z <= 3.6e-84)) tmp = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z))); else tmp = Float64(Float64(x / z) * Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8.6e-17) || ~((z <= 3.6e-84))) tmp = x * (-1.0 + ((y + 1.0) / z)); else tmp = (x / z) * (y + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.6e-17], N[Not[LessEqual[z, 3.6e-84]], $MachinePrecision]], N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{-17} \lor \neg \left(z \leq 3.6 \cdot 10^{-84}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + 1\right)\\
\end{array}
\end{array}
if z < -8.60000000000000046e-17 or 3.60000000000000003e-84 < z Initial program 77.1%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
if -8.60000000000000046e-17 < z < 3.60000000000000003e-84Initial program 99.8%
associate-/l*89.4%
Simplified89.4%
clear-num89.3%
un-div-inv89.4%
+-commutative89.4%
Applied egg-rr89.4%
Taylor expanded in z around 0 89.4%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
associate-*l/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -2e+30) (not (<= z 8.8e+15))) (* x (+ (/ y z) -1.0)) (* (+ (- y z) 1.0) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2e+30) || !(z <= 8.8e+15)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = ((y - z) + 1.0) * (x / 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 <= (-2d+30)) .or. (.not. (z <= 8.8d+15))) then
tmp = x * ((y / z) + (-1.0d0))
else
tmp = ((y - z) + 1.0d0) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2e+30) || !(z <= 8.8e+15)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = ((y - z) + 1.0) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2e+30) or not (z <= 8.8e+15): tmp = x * ((y / z) + -1.0) else: tmp = ((y - z) + 1.0) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2e+30) || !(z <= 8.8e+15)) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); else tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2e+30) || ~((z <= 8.8e+15))) tmp = x * ((y / z) + -1.0); else tmp = ((y - z) + 1.0) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2e+30], N[Not[LessEqual[z, 8.8e+15]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+30} \lor \neg \left(z \leq 8.8 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -2e30 or 8.8e15 < z Initial program 70.7%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
if -2e30 < z < 8.8e15Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -90.0) (not (<= y 2.45e-14))) (* x (+ (/ y z) -1.0)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -90.0) || !(y <= 2.45e-14)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = (x / z) - 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 <= (-90.0d0)) .or. (.not. (y <= 2.45d-14))) then
tmp = x * ((y / z) + (-1.0d0))
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -90.0) || !(y <= 2.45e-14)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -90.0) or not (y <= 2.45e-14): tmp = x * ((y / z) + -1.0) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -90.0) || !(y <= 2.45e-14)) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -90.0) || ~((y <= 2.45e-14))) tmp = x * ((y / z) + -1.0); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -90.0], N[Not[LessEqual[y, 2.45e-14]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -90 \lor \neg \left(y \leq 2.45 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -90 or 2.44999999999999997e-14 < y Initial program 89.8%
associate-/l*91.2%
+-commutative91.2%
associate-+r-91.2%
div-sub91.2%
*-inverses91.2%
sub-neg91.2%
metadata-eval91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in y around inf 91.1%
if -90 < y < 2.44999999999999997e-14Initial program 84.5%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
distribute-rgt-in99.8%
associate-*l/100.0%
*-lft-identity100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification95.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.00025) (not (<= z 1.0))) (* x (+ (/ y z) -1.0)) (* (/ x z) (+ y 1.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.00025) || !(z <= 1.0)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = (x / z) * (y + 1.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) :: tmp
if ((z <= (-0.00025d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y / z) + (-1.0d0))
else
tmp = (x / z) * (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.00025) || !(z <= 1.0)) {
tmp = x * ((y / z) + -1.0);
} else {
tmp = (x / z) * (y + 1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.00025) or not (z <= 1.0): tmp = x * ((y / z) + -1.0) else: tmp = (x / z) * (y + 1.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.00025) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y / z) + -1.0)); else tmp = Float64(Float64(x / z) * Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.00025) || ~((z <= 1.0))) tmp = x * ((y / z) + -1.0); else tmp = (x / z) * (y + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.00025], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00025 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + 1\right)\\
\end{array}
\end{array}
if z < -2.5000000000000001e-4 or 1 < z Initial program 73.8%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 98.8%
if -2.5000000000000001e-4 < z < 1Initial program 99.8%
associate-/l*90.7%
Simplified90.7%
clear-num90.7%
un-div-inv90.8%
+-commutative90.8%
Applied egg-rr90.8%
Taylor expanded in z around 0 90.1%
Taylor expanded in x around 0 99.1%
+-commutative99.1%
associate-*l/99.1%
Simplified99.1%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (<= y -5.8e+20) (* y (/ x z)) (if (<= y 23000000000000.0) (- (/ x z) x) (* x (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.8e+20) {
tmp = y * (x / z);
} else if (y <= 23000000000000.0) {
tmp = (x / z) - 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 (y <= (-5.8d+20)) then
tmp = y * (x / z)
else if (y <= 23000000000000.0d0) then
tmp = (x / z) - 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 (y <= -5.8e+20) {
tmp = y * (x / z);
} else if (y <= 23000000000000.0) {
tmp = (x / z) - x;
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.8e+20: tmp = y * (x / z) elif y <= 23000000000000.0: tmp = (x / z) - x else: tmp = x * (y / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.8e+20) tmp = Float64(y * Float64(x / z)); elseif (y <= 23000000000000.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.8e+20) tmp = y * (x / z); elseif (y <= 23000000000000.0) tmp = (x / z) - x; else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.8e+20], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 23000000000000.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+20}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 23000000000000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < -5.8e20Initial program 88.6%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.3%
+-commutative85.3%
Applied egg-rr85.3%
Taylor expanded in y around inf 70.2%
associate-/r/81.8%
Applied egg-rr81.8%
if -5.8e20 < y < 2.3e13Initial program 85.3%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
sub-neg99.0%
metadata-eval99.0%
distribute-rgt-in99.0%
associate-*l/99.2%
*-lft-identity99.2%
neg-mul-199.2%
unsub-neg99.2%
Simplified99.2%
if 2.3e13 < y Initial program 90.0%
associate-/l*94.9%
+-commutative94.9%
associate-+r-94.9%
div-sub94.9%
*-inverses94.9%
sub-neg94.9%
metadata-eval94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in y around inf 76.8%
associate-/l*75.4%
Simplified75.4%
Final simplification88.2%
(FPCore (x y z) :precision binary64 (if (<= y -4.8e+26) (* y (/ x z)) (if (<= y 13000000000000.0) (- (/ x z) x) (/ (* x y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.8e+26) {
tmp = y * (x / z);
} else if (y <= 13000000000000.0) {
tmp = (x / z) - 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 (y <= (-4.8d+26)) then
tmp = y * (x / z)
else if (y <= 13000000000000.0d0) then
tmp = (x / z) - 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 (y <= -4.8e+26) {
tmp = y * (x / z);
} else if (y <= 13000000000000.0) {
tmp = (x / z) - x;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.8e+26: tmp = y * (x / z) elif y <= 13000000000000.0: tmp = (x / z) - x else: tmp = (x * y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.8e+26) tmp = Float64(y * Float64(x / z)); elseif (y <= 13000000000000.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.8e+26) tmp = y * (x / z); elseif (y <= 13000000000000.0) tmp = (x / z) - x; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.8e+26], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 13000000000000.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 13000000000000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -4.80000000000000009e26Initial program 88.6%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.3%
+-commutative85.3%
Applied egg-rr85.3%
Taylor expanded in y around inf 70.2%
associate-/r/81.8%
Applied egg-rr81.8%
if -4.80000000000000009e26 < y < 1.3e13Initial program 85.3%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
sub-neg99.0%
metadata-eval99.0%
distribute-rgt-in99.0%
associate-*l/99.2%
*-lft-identity99.2%
neg-mul-199.2%
unsub-neg99.2%
Simplified99.2%
if 1.3e13 < y Initial program 90.0%
associate-/l*94.9%
+-commutative94.9%
associate-+r-94.9%
div-sub94.9%
*-inverses94.9%
sub-neg94.9%
metadata-eval94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in y around inf 76.8%
Final simplification88.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ (- y z) 1.0))) (if (<= x 1.55e-54) (/ (* x t_0) z) (/ x (/ z t_0)))))
double code(double x, double y, double z) {
double t_0 = (y - z) + 1.0;
double tmp;
if (x <= 1.55e-54) {
tmp = (x * t_0) / z;
} else {
tmp = x / (z / 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 = (y - z) + 1.0d0
if (x <= 1.55d-54) then
tmp = (x * t_0) / z
else
tmp = x / (z / t_0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y - z) + 1.0;
double tmp;
if (x <= 1.55e-54) {
tmp = (x * t_0) / z;
} else {
tmp = x / (z / t_0);
}
return tmp;
}
def code(x, y, z): t_0 = (y - z) + 1.0 tmp = 0 if x <= 1.55e-54: tmp = (x * t_0) / z else: tmp = x / (z / t_0) return tmp
function code(x, y, z) t_0 = Float64(Float64(y - z) + 1.0) tmp = 0.0 if (x <= 1.55e-54) tmp = Float64(Float64(x * t_0) / z); else tmp = Float64(x / Float64(z / t_0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - z) + 1.0; tmp = 0.0; if (x <= 1.55e-54) tmp = (x * t_0) / z; else tmp = x / (z / t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x, 1.55e-54], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - z\right) + 1\\
\mathbf{if}\;x \leq 1.55 \cdot 10^{-54}:\\
\;\;\;\;\frac{x \cdot t\_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t\_0}}\\
\end{array}
\end{array}
if x < 1.55000000000000002e-54Initial program 91.5%
if 1.55000000000000002e-54 < x Initial program 78.0%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification94.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 2000.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2000.0)) {
tmp = -x;
} else {
tmp = x / 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.0d0)) .or. (.not. (z <= 2000.0d0))) then
tmp = -x
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 2000.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 2000.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 2000.0)) tmp = Float64(-x); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 2000.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 2000.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 2000\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -1 or 2e3 < z Initial program 73.4%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 69.7%
neg-mul-169.7%
Simplified69.7%
if -1 < z < 2e3Initial program 99.8%
associate-/l*90.9%
+-commutative90.9%
associate-+r-90.9%
div-sub90.9%
*-inverses90.9%
sub-neg90.9%
metadata-eval90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in y around 0 57.1%
sub-neg57.1%
metadata-eval57.1%
distribute-rgt-in57.2%
associate-*l/57.3%
*-lft-identity57.3%
neg-mul-157.3%
unsub-neg57.3%
Simplified57.3%
Taylor expanded in z around 0 56.6%
Final simplification62.7%
(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 Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 87.4%
associate-/l*95.1%
+-commutative95.1%
associate-+r-95.1%
div-sub95.1%
*-inverses95.1%
sub-neg95.1%
metadata-eval95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in z around inf 34.3%
neg-mul-134.3%
Simplified34.3%
Final simplification34.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 87.4%
*-commutative87.4%
associate-/l*89.7%
+-commutative89.7%
Applied egg-rr89.7%
associate-*r/87.4%
clear-num87.3%
*-commutative87.3%
+-commutative87.3%
associate-+l-87.3%
Applied egg-rr87.3%
Taylor expanded in z around inf 34.3%
frac-2neg34.3%
metadata-eval34.3%
remove-double-div34.3%
neg-sub034.3%
sub-neg34.3%
add-sqr-sqrt16.2%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod1.4%
add-sqr-sqrt3.1%
Applied egg-rr3.1%
+-lft-identity3.1%
Simplified3.1%
Final simplification3.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* (+ 1.0 y) (/ x z)) x)))
(if (< x -2.71483106713436e-162)
t_0
(if (< x 3.874108816439546e-197)
(* (* x (+ (- y z) 1.0)) (/ 1.0 z))
t_0))))
double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} 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 = ((1.0d0 + y) * (x / z)) - x
if (x < (-2.71483106713436d-162)) then
tmp = t_0
else if (x < 3.874108816439546d-197) then
tmp = (x * ((y - z) + 1.0d0)) * (1.0d0 / z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((1.0 + y) * (x / z)) - x tmp = 0 if x < -2.71483106713436e-162: tmp = t_0 elif x < 3.874108816439546e-197: tmp = (x * ((y - z) + 1.0)) * (1.0 / z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(1.0 + y) * Float64(x / z)) - x) tmp = 0.0 if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) * Float64(1.0 / z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((1.0 + y) * (x / z)) - x; tmp = 0.0; if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = (x * ((y - z) + 1.0)) * (1.0 / z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[Less[x, -2.71483106713436e-162], t$95$0, If[Less[x, 3.874108816439546e-197], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + y\right) \cdot \frac{x}{z} - x\\
\mathbf{if}\;x < -2.71483106713436 \cdot 10^{-162}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x < 3.874108816439546 \cdot 10^{-197}:\\
\;\;\;\;\left(x \cdot \left(\left(y - z\right) + 1\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024077
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(if (< x -2.71483106713436e-162) (- (* (+ 1.0 y) (/ x z)) x) (if (< x 3.874108816439546e-197) (* (* x (+ (- y z) 1.0)) (/ 1.0 z)) (- (* (+ 1.0 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1.0)) z))