
(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 14 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 (if (or (<= z -1e-17) (not (<= z 1.1e-51))) (* x (+ -1.0 (/ (+ y 1.0) z))) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-17) || !(z <= 1.1e-51)) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else {
tmp = (x + (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 <= (-1d-17)) .or. (.not. (z <= 1.1d-51))) then
tmp = x * ((-1.0d0) + ((y + 1.0d0) / z))
else
tmp = (x + (x * y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1e-17) || !(z <= 1.1e-51)) {
tmp = x * (-1.0 + ((y + 1.0) / z));
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1e-17) or not (z <= 1.1e-51): tmp = x * (-1.0 + ((y + 1.0) / z)) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1e-17) || !(z <= 1.1e-51)) tmp = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z))); else tmp = Float64(Float64(x + Float64(x * y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1e-17) || ~((z <= 1.1e-51))) tmp = x * (-1.0 + ((y + 1.0) / z)); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1e-17], N[Not[LessEqual[z, 1.1e-51]], $MachinePrecision]], N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-17} \lor \neg \left(z \leq 1.1 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -1.00000000000000007e-17 or 1.1e-51 < z Initial program 75.3%
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%
if -1.00000000000000007e-17 < z < 1.1e-51Initial program 99.9%
div-inv99.6%
distribute-lft-in99.7%
fma-define99.6%
*-rgt-identity99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -2.8e+71)
(- x)
(if (<= z -9.8e-50)
t_0
(if (<= z -3e-167)
(/ x z)
(if (<= z 2.75e-118)
t_0
(if (<= z 5.6e-19)
(/ x z)
(if (<= z 3e+19) (* x (/ y z)) (- x)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2.8e+71) {
tmp = -x;
} else if (z <= -9.8e-50) {
tmp = t_0;
} else if (z <= -3e-167) {
tmp = x / z;
} else if (z <= 2.75e-118) {
tmp = t_0;
} else if (z <= 5.6e-19) {
tmp = x / z;
} else if (z <= 3e+19) {
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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-2.8d+71)) then
tmp = -x
else if (z <= (-9.8d-50)) then
tmp = t_0
else if (z <= (-3d-167)) then
tmp = x / z
else if (z <= 2.75d-118) then
tmp = t_0
else if (z <= 5.6d-19) then
tmp = x / z
else if (z <= 3d+19) 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 t_0 = y * (x / z);
double tmp;
if (z <= -2.8e+71) {
tmp = -x;
} else if (z <= -9.8e-50) {
tmp = t_0;
} else if (z <= -3e-167) {
tmp = x / z;
} else if (z <= 2.75e-118) {
tmp = t_0;
} else if (z <= 5.6e-19) {
tmp = x / z;
} else if (z <= 3e+19) {
tmp = x * (y / z);
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -2.8e+71: tmp = -x elif z <= -9.8e-50: tmp = t_0 elif z <= -3e-167: tmp = x / z elif z <= 2.75e-118: tmp = t_0 elif z <= 5.6e-19: tmp = x / z elif z <= 3e+19: tmp = x * (y / z) else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -2.8e+71) tmp = Float64(-x); elseif (z <= -9.8e-50) tmp = t_0; elseif (z <= -3e-167) tmp = Float64(x / z); elseif (z <= 2.75e-118) tmp = t_0; elseif (z <= 5.6e-19) tmp = Float64(x / z); elseif (z <= 3e+19) tmp = Float64(x * Float64(y / z)); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (z <= -2.8e+71) tmp = -x; elseif (z <= -9.8e-50) tmp = t_0; elseif (z <= -3e-167) tmp = x / z; elseif (z <= 2.75e-118) tmp = t_0; elseif (z <= 5.6e-19) tmp = x / z; elseif (z <= 3e+19) tmp = x * (y / z); else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+71], (-x), If[LessEqual[z, -9.8e-50], t$95$0, If[LessEqual[z, -3e-167], N[(x / z), $MachinePrecision], If[LessEqual[z, 2.75e-118], t$95$0, If[LessEqual[z, 5.6e-19], N[(x / z), $MachinePrecision], If[LessEqual[z, 3e+19], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+71}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-50}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-167}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -2.80000000000000002e71 or 3e19 < z Initial program 65.1%
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 z around inf 84.4%
neg-mul-184.4%
Simplified84.4%
if -2.80000000000000002e71 < z < -9.7999999999999997e-50 or -2.9999999999999998e-167 < z < 2.7500000000000001e-118Initial program 99.0%
associate-/l*92.1%
+-commutative92.1%
associate-+r-92.1%
div-sub92.1%
*-inverses92.1%
sub-neg92.1%
metadata-eval92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in y around inf 67.3%
*-commutative67.3%
associate-/l*69.0%
Applied egg-rr69.0%
if -9.7999999999999997e-50 < z < -2.9999999999999998e-167 or 2.7500000000000001e-118 < z < 5.60000000000000005e-19Initial program 100.0%
associate-/l*97.3%
+-commutative97.3%
associate-+r-97.3%
div-sub97.3%
*-inverses97.3%
sub-neg97.3%
metadata-eval97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in y around 0 70.3%
sub-neg70.3%
metadata-eval70.3%
distribute-rgt-in70.3%
associate-*l/70.6%
*-lft-identity70.6%
neg-mul-170.6%
unsub-neg70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
if 5.60000000000000005e-19 < z < 3e19Initial program 99.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 inf 80.4%
associate-/l*80.5%
Simplified80.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= y -2.2e+84)
t_0
(if (<= y -2.7e-104)
(- x)
(if (<= y 8.6e-262)
(/ x z)
(if (<= y 1.2e-157) (- x) (if (<= y 1.0) (/ x z) t_0)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (y <= -2.2e+84) {
tmp = t_0;
} else if (y <= -2.7e-104) {
tmp = -x;
} else if (y <= 8.6e-262) {
tmp = x / z;
} else if (y <= 1.2e-157) {
tmp = -x;
} else if (y <= 1.0) {
tmp = x / 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 = x * (y / z)
if (y <= (-2.2d+84)) then
tmp = t_0
else if (y <= (-2.7d-104)) then
tmp = -x
else if (y <= 8.6d-262) then
tmp = x / z
else if (y <= 1.2d-157) then
tmp = -x
else if (y <= 1.0d0) then
tmp = x / z
else
tmp = t_0
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 (y <= -2.2e+84) {
tmp = t_0;
} else if (y <= -2.7e-104) {
tmp = -x;
} else if (y <= 8.6e-262) {
tmp = x / z;
} else if (y <= 1.2e-157) {
tmp = -x;
} else if (y <= 1.0) {
tmp = x / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if y <= -2.2e+84: tmp = t_0 elif y <= -2.7e-104: tmp = -x elif y <= 8.6e-262: tmp = x / z elif y <= 1.2e-157: tmp = -x elif y <= 1.0: tmp = x / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y / z)) tmp = 0.0 if (y <= -2.2e+84) tmp = t_0; elseif (y <= -2.7e-104) tmp = Float64(-x); elseif (y <= 8.6e-262) tmp = Float64(x / z); elseif (y <= 1.2e-157) tmp = Float64(-x); elseif (y <= 1.0) tmp = Float64(x / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y / z); tmp = 0.0; if (y <= -2.2e+84) tmp = t_0; elseif (y <= -2.7e-104) tmp = -x; elseif (y <= 8.6e-262) tmp = x / z; elseif (y <= 1.2e-157) tmp = -x; elseif (y <= 1.0) tmp = x / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+84], t$95$0, If[LessEqual[y, -2.7e-104], (-x), If[LessEqual[y, 8.6e-262], N[(x / z), $MachinePrecision], If[LessEqual[y, 1.2e-157], (-x), If[LessEqual[y, 1.0], N[(x / z), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-104}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-262}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-157}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.1999999999999998e84 or 1 < y Initial program 88.5%
associate-/l*92.1%
+-commutative92.1%
associate-+r-92.1%
div-sub92.1%
*-inverses92.1%
sub-neg92.1%
metadata-eval92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in y around inf 81.0%
associate-/l*77.4%
Simplified77.4%
if -2.1999999999999998e84 < y < -2.6999999999999998e-104 or 8.6000000000000002e-262 < y < 1.2e-157Initial program 79.0%
associate-/l*98.6%
+-commutative98.6%
associate-+r-98.6%
div-sub98.6%
*-inverses98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in z around inf 64.2%
neg-mul-164.2%
Simplified64.2%
if -2.6999999999999998e-104 < y < 8.6000000000000002e-262 or 1.2e-157 < y < 1Initial program 91.4%
associate-/l*99.7%
+-commutative99.7%
associate-+r-99.7%
div-sub99.7%
*-inverses99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 99.1%
sub-neg99.1%
metadata-eval99.1%
distribute-rgt-in99.1%
associate-*l/99.3%
*-lft-identity99.3%
neg-mul-199.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in z around 0 63.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (/ z x))))
(if (<= y -7.6e+84)
t_0
(if (<= y -3.6e+75)
(- x)
(if (or (<= y -1.6e+27) (not (<= y 9.5e+52))) t_0 (- (/ x z) x))))))
double code(double x, double y, double z) {
double t_0 = y / (z / x);
double tmp;
if (y <= -7.6e+84) {
tmp = t_0;
} else if (y <= -3.6e+75) {
tmp = -x;
} else if ((y <= -1.6e+27) || !(y <= 9.5e+52)) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y / (z / x)
if (y <= (-7.6d+84)) then
tmp = t_0
else if (y <= (-3.6d+75)) then
tmp = -x
else if ((y <= (-1.6d+27)) .or. (.not. (y <= 9.5d+52))) then
tmp = t_0
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y / (z / x);
double tmp;
if (y <= -7.6e+84) {
tmp = t_0;
} else if (y <= -3.6e+75) {
tmp = -x;
} else if ((y <= -1.6e+27) || !(y <= 9.5e+52)) {
tmp = t_0;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): t_0 = y / (z / x) tmp = 0 if y <= -7.6e+84: tmp = t_0 elif y <= -3.6e+75: tmp = -x elif (y <= -1.6e+27) or not (y <= 9.5e+52): tmp = t_0 else: tmp = (x / z) - x return tmp
function code(x, y, z) t_0 = Float64(y / Float64(z / x)) tmp = 0.0 if (y <= -7.6e+84) tmp = t_0; elseif (y <= -3.6e+75) tmp = Float64(-x); elseif ((y <= -1.6e+27) || !(y <= 9.5e+52)) tmp = t_0; else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y / (z / x); tmp = 0.0; if (y <= -7.6e+84) tmp = t_0; elseif (y <= -3.6e+75) tmp = -x; elseif ((y <= -1.6e+27) || ~((y <= 9.5e+52))) tmp = t_0; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.6e+84], t$95$0, If[LessEqual[y, -3.6e+75], (-x), If[Or[LessEqual[y, -1.6e+27], N[Not[LessEqual[y, 9.5e+52]], $MachinePrecision]], t$95$0, N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{\frac{z}{x}}\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+75}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{+27} \lor \neg \left(y \leq 9.5 \cdot 10^{+52}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -7.6000000000000002e84 or -3.6e75 < y < -1.60000000000000008e27 or 9.49999999999999994e52 < y Initial program 88.8%
associate-/l*91.5%
+-commutative91.5%
associate-+r-91.5%
div-sub91.5%
*-inverses91.5%
sub-neg91.5%
metadata-eval91.5%
+-commutative91.5%
Simplified91.5%
Taylor expanded in y around inf 81.5%
*-commutative81.5%
associate-/l*84.0%
Applied egg-rr84.0%
clear-num84.0%
un-div-inv84.1%
Applied egg-rr84.1%
if -7.6000000000000002e84 < y < -3.6e75Initial program 68.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 z around inf 83.6%
neg-mul-183.6%
Simplified83.6%
if -1.60000000000000008e27 < y < 9.49999999999999994e52Initial program 85.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 0 92.7%
sub-neg92.7%
metadata-eval92.7%
distribute-rgt-in92.8%
associate-*l/93.0%
*-lft-identity93.0%
neg-mul-193.0%
unsub-neg93.0%
Simplified93.0%
Final simplification88.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= y -2.2e+84)
t_0
(if (<= y -3.5e+75)
(- x)
(if (or (<= y -1.04e+27) (not (<= y 9.1e+49))) t_0 (- (/ x z) x))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (y <= -2.2e+84) {
tmp = t_0;
} else if (y <= -3.5e+75) {
tmp = -x;
} else if ((y <= -1.04e+27) || !(y <= 9.1e+49)) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (y <= (-2.2d+84)) then
tmp = t_0
else if (y <= (-3.5d+75)) then
tmp = -x
else if ((y <= (-1.04d+27)) .or. (.not. (y <= 9.1d+49))) then
tmp = t_0
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (y <= -2.2e+84) {
tmp = t_0;
} else if (y <= -3.5e+75) {
tmp = -x;
} else if ((y <= -1.04e+27) || !(y <= 9.1e+49)) {
tmp = t_0;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if y <= -2.2e+84: tmp = t_0 elif y <= -3.5e+75: tmp = -x elif (y <= -1.04e+27) or not (y <= 9.1e+49): tmp = t_0 else: tmp = (x / z) - x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -2.2e+84) tmp = t_0; elseif (y <= -3.5e+75) tmp = Float64(-x); elseif ((y <= -1.04e+27) || !(y <= 9.1e+49)) tmp = t_0; else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (y <= -2.2e+84) tmp = t_0; elseif (y <= -3.5e+75) tmp = -x; elseif ((y <= -1.04e+27) || ~((y <= 9.1e+49))) tmp = t_0; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+84], t$95$0, If[LessEqual[y, -3.5e+75], (-x), If[Or[LessEqual[y, -1.04e+27], N[Not[LessEqual[y, 9.1e+49]], $MachinePrecision]], t$95$0, N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{+75}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -1.04 \cdot 10^{+27} \lor \neg \left(y \leq 9.1 \cdot 10^{+49}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.1999999999999998e84 or -3.4999999999999998e75 < y < -1.04000000000000001e27 or 9.09999999999999986e49 < y Initial program 88.8%
associate-/l*91.5%
+-commutative91.5%
associate-+r-91.5%
div-sub91.5%
*-inverses91.5%
sub-neg91.5%
metadata-eval91.5%
+-commutative91.5%
Simplified91.5%
Taylor expanded in y around inf 81.5%
*-commutative81.5%
associate-/l*84.0%
Applied egg-rr84.0%
if -2.1999999999999998e84 < y < -3.4999999999999998e75Initial program 68.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 z around inf 83.6%
neg-mul-183.6%
Simplified83.6%
if -1.04000000000000001e27 < y < 9.09999999999999986e49Initial program 85.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 0 92.7%
sub-neg92.7%
metadata-eval92.7%
distribute-rgt-in92.8%
associate-*l/93.0%
*-lft-identity93.0%
neg-mul-193.0%
unsub-neg93.0%
Simplified93.0%
Final simplification88.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -42.0) (not (<= z 5.4e-18))) (* x (+ -1.0 (/ y z))) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x + (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 <= (-42.0d0)) .or. (.not. (z <= 5.4d-18))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (x + (x * y)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -42.0) or not (z <= 5.4e-18): tmp = x * (-1.0 + (y / z)) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -42.0) || !(z <= 5.4e-18)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(x + Float64(x * y)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -42.0) || ~((z <= 5.4e-18))) tmp = x * (-1.0 + (y / z)); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -42.0], N[Not[LessEqual[z, 5.4e-18]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -42 \lor \neg \left(z \leq 5.4 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -42 or 5.39999999999999977e-18 < z Initial program 72.9%
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.2%
if -42 < z < 5.39999999999999977e-18Initial program 99.9%
div-inv99.6%
distribute-lft-in99.7%
fma-define99.6%
*-rgt-identity99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -42.0) (not (<= z 5.4e-18))) (* x (+ -1.0 (/ y z))) (/ (* x (+ y 1.0)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x * (y + 1.0)) / 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 <= (-42.0d0)) .or. (.not. (z <= 5.4d-18))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (x * (y + 1.0d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x * (y + 1.0)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -42.0) or not (z <= 5.4e-18): tmp = x * (-1.0 + (y / z)) else: tmp = (x * (y + 1.0)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -42.0) || !(z <= 5.4e-18)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(x * Float64(y + 1.0)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -42.0) || ~((z <= 5.4e-18))) tmp = x * (-1.0 + (y / z)); else tmp = (x * (y + 1.0)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -42.0], N[Not[LessEqual[z, 5.4e-18]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -42 \lor \neg \left(z \leq 5.4 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + 1\right)}{z}\\
\end{array}
\end{array}
if z < -42 or 5.39999999999999977e-18 < z Initial program 72.9%
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.2%
if -42 < z < 5.39999999999999977e-18Initial program 99.9%
associate-/l*92.6%
+-commutative92.6%
associate-+r-92.6%
div-sub92.6%
*-inverses92.6%
sub-neg92.6%
metadata-eval92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around 0 99.8%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -42.0) (not (<= z 5.4e-18))) (* x (+ -1.0 (/ y z))) (* (+ y 1.0) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (y + 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 <= (-42.0d0)) .or. (.not. (z <= 5.4d-18))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = (y + 1.0d0) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (y + 1.0) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -42.0) or not (z <= 5.4e-18): tmp = x * (-1.0 + (y / z)) else: tmp = (y + 1.0) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -42.0) || !(z <= 5.4e-18)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(y + 1.0) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -42.0) || ~((z <= 5.4e-18))) tmp = x * (-1.0 + (y / z)); else tmp = (y + 1.0) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -42.0], N[Not[LessEqual[z, 5.4e-18]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -42 \lor \neg \left(z \leq 5.4 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + 1\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -42 or 5.39999999999999977e-18 < z Initial program 72.9%
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.2%
if -42 < z < 5.39999999999999977e-18Initial program 99.9%
associate-/l*92.6%
+-commutative92.6%
associate-+r-92.6%
div-sub92.6%
*-inverses92.6%
sub-neg92.6%
metadata-eval92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*l/99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -42.0) (not (<= z 5.4e-18))) (* x (+ -1.0 (/ y z))) (* x (/ (+ y 1.0) z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = x * ((y + 1.0) / 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 <= (-42.0d0)) .or. (.not. (z <= 5.4d-18))) then
tmp = x * ((-1.0d0) + (y / z))
else
tmp = x * ((y + 1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -42.0) || !(z <= 5.4e-18)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = x * ((y + 1.0) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -42.0) or not (z <= 5.4e-18): tmp = x * (-1.0 + (y / z)) else: tmp = x * ((y + 1.0) / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -42.0) || !(z <= 5.4e-18)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(x * Float64(Float64(y + 1.0) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -42.0) || ~((z <= 5.4e-18))) tmp = x * (-1.0 + (y / z)); else tmp = x * ((y + 1.0) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -42.0], N[Not[LessEqual[z, 5.4e-18]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -42 \lor \neg \left(z \leq 5.4 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + 1}{z}\\
\end{array}
\end{array}
if z < -42 or 5.39999999999999977e-18 < z Initial program 72.9%
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.2%
if -42 < z < 5.39999999999999977e-18Initial program 99.9%
associate-/l*92.6%
+-commutative92.6%
associate-+r-92.6%
div-sub92.6%
*-inverses92.6%
sub-neg92.6%
metadata-eval92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around 0 99.8%
associate-/l*92.5%
Simplified92.5%
Final simplification95.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -32.0) (not (<= y 1.0))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -32.0) || !(y <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} 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 <= (-32.0d0)) .or. (.not. (y <= 1.0d0))) then
tmp = x * ((-1.0d0) + (y / z))
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 <= -32.0) || !(y <= 1.0)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -32.0) or not (y <= 1.0): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -32.0) || !(y <= 1.0)) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -32.0) || ~((y <= 1.0))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -32.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -32 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -32 or 1 < y Initial program 87.5%
associate-/l*93.1%
+-commutative93.1%
associate-+r-93.1%
div-sub93.1%
*-inverses93.1%
sub-neg93.1%
metadata-eval93.1%
+-commutative93.1%
Simplified93.1%
Taylor expanded in y around inf 92.0%
if -32 < y < 1Initial program 85.9%
associate-/l*99.7%
+-commutative99.7%
associate-+r-99.7%
div-sub99.7%
*-inverses99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 98.7%
sub-neg98.7%
metadata-eval98.7%
distribute-rgt-in98.7%
associate-*l/99.0%
*-lft-identity99.0%
neg-mul-199.0%
unsub-neg99.0%
Simplified99.0%
Final simplification95.3%
(FPCore (x y z) :precision binary64 (if (<= z -42.0) (* x (+ -1.0 (/ y z))) (if (<= z 5.4e-18) (/ (+ x (* x y)) z) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -42.0) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 5.4e-18) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x * (y / 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 (z <= (-42.0d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 5.4d-18) then
tmp = (x + (x * y)) / z
else
tmp = (x * (y / z)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -42.0) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 5.4e-18) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -42.0: tmp = x * (-1.0 + (y / z)) elif z <= 5.4e-18: tmp = (x + (x * y)) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -42.0) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 5.4e-18) tmp = Float64(Float64(x + Float64(x * y)) / z); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -42.0) tmp = x * (-1.0 + (y / z)); elseif (z <= 5.4e-18) tmp = (x + (x * y)) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -42.0], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-18], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -42:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-18}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -42Initial program 78.2%
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.2%
if -42 < z < 5.39999999999999977e-18Initial program 99.9%
div-inv99.6%
distribute-lft-in99.7%
fma-define99.6%
*-rgt-identity99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 99.8%
if 5.39999999999999977e-18 < z Initial program 69.2%
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.1%
distribute-lft-in99.1%
*-commutative99.1%
neg-mul-199.1%
Applied egg-rr99.1%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= x 1.75e-39) (/ (* x (+ (- y z) 1.0)) z) (* x (+ -1.0 (/ (+ y 1.0) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.75e-39) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (-1.0 + ((y + 1.0) / 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 <= 1.75d-39) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = x * ((-1.0d0) + ((y + 1.0d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.75e-39) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (-1.0 + ((y + 1.0) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.75e-39: tmp = (x * ((y - z) + 1.0)) / z else: tmp = x * (-1.0 + ((y + 1.0) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.75e-39) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(x * Float64(-1.0 + Float64(Float64(y + 1.0) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.75e-39) tmp = (x * ((y - z) + 1.0)) / z; else tmp = x * (-1.0 + ((y + 1.0) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.75e-39], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(-1.0 + N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.75 \cdot 10^{-39}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y + 1}{z}\right)\\
\end{array}
\end{array}
if x < 1.75e-39Initial program 88.4%
if 1.75e-39 < x Initial program 82.1%
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%
Final simplification91.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.0016) (not (<= z 0.48))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.0016) || !(z <= 0.48)) {
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 <= (-0.0016d0)) .or. (.not. (z <= 0.48d0))) 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 <= -0.0016) || !(z <= 0.48)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.0016) or not (z <= 0.48): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.0016) || !(z <= 0.48)) tmp = Float64(-x); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.0016) || ~((z <= 0.48))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.0016], N[Not[LessEqual[z, 0.48]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0016 \lor \neg \left(z \leq 0.48\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -0.00160000000000000008 or 0.47999999999999998 < z Initial program 72.5%
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 z around inf 72.5%
neg-mul-172.5%
Simplified72.5%
if -0.00160000000000000008 < z < 0.47999999999999998Initial program 99.9%
associate-/l*92.7%
+-commutative92.7%
associate-+r-92.7%
div-sub92.7%
*-inverses92.7%
sub-neg92.7%
metadata-eval92.7%
+-commutative92.7%
Simplified92.7%
Taylor expanded in y around 0 49.1%
sub-neg49.1%
metadata-eval49.1%
distribute-rgt-in49.1%
associate-*l/49.3%
*-lft-identity49.3%
neg-mul-149.3%
unsub-neg49.3%
Simplified49.3%
Taylor expanded in z around 0 49.3%
Final simplification60.4%
(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 86.7%
associate-/l*96.2%
+-commutative96.2%
associate-+r-96.2%
div-sub96.2%
*-inverses96.2%
sub-neg96.2%
metadata-eval96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 36.5%
neg-mul-136.5%
Simplified36.5%
(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 2024085
(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))