
(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 16 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 (<= z -2.55e+23) (/ x (/ z (+ 1.0 (- y z)))) (if (<= z 0.00135) (/ (+ x (* x (- y z))) z) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.55e+23) {
tmp = x / (z / (1.0 + (y - z)));
} else if (z <= 0.00135) {
tmp = (x + (x * (y - z))) / 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 <= (-2.55d+23)) then
tmp = x / (z / (1.0d0 + (y - z)))
else if (z <= 0.00135d0) then
tmp = (x + (x * (y - z))) / 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 <= -2.55e+23) {
tmp = x / (z / (1.0 + (y - z)));
} else if (z <= 0.00135) {
tmp = (x + (x * (y - z))) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.55e+23: tmp = x / (z / (1.0 + (y - z))) elif z <= 0.00135: tmp = (x + (x * (y - z))) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.55e+23) tmp = Float64(x / Float64(z / Float64(1.0 + Float64(y - z)))); elseif (z <= 0.00135) tmp = Float64(Float64(x + Float64(x * Float64(y - z))) / 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 <= -2.55e+23) tmp = x / (z / (1.0 + (y - z))); elseif (z <= 0.00135) tmp = (x + (x * (y - z))) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.55e+23], N[(x / N[(z / N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00135], N[(N[(x + N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{\frac{z}{1 + \left(y - z\right)}}\\
\mathbf{elif}\;z \leq 0.00135:\\
\;\;\;\;\frac{x + x \cdot \left(y - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -2.5500000000000001e23Initial program 80.6%
distribute-lft-in80.6%
*-rgt-identity80.6%
Applied egg-rr80.6%
Taylor expanded in x around 0 80.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
if -2.5500000000000001e23 < z < 0.0013500000000000001Initial program 99.9%
distribute-lft-in99.9%
*-rgt-identity99.9%
Applied egg-rr99.9%
if 0.0013500000000000001 < z Initial program 78.7%
Taylor expanded in z around 0 88.3%
Taylor expanded in y around inf 88.3%
associate-*l/94.0%
Simplified94.0%
neg-mul-194.0%
+-commutative94.0%
unsub-neg94.0%
frac-2neg94.0%
associate-/r/99.9%
div-inv99.8%
add-sqr-sqrt44.7%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod36.0%
add-sqr-sqrt61.4%
clear-num61.4%
add-sqr-sqrt0.0%
sqrt-unprod86.1%
sqr-neg86.1%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= y -1.25e+26)
t_0
(if (<= y -7.1e-62)
(- x)
(if (<= y -5.5e-191)
(/ x z)
(if (<= y 2.1e-209)
(- x)
(if (<= y 1.45e-186)
(/ x z)
(if (<= y 1.2e-138)
(- x)
(if (<= y 420000000.0) (/ x z) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (y <= -1.25e+26) {
tmp = t_0;
} else if (y <= -7.1e-62) {
tmp = -x;
} else if (y <= -5.5e-191) {
tmp = x / z;
} else if (y <= 2.1e-209) {
tmp = -x;
} else if (y <= 1.45e-186) {
tmp = x / z;
} else if (y <= 1.2e-138) {
tmp = -x;
} else if (y <= 420000000.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 <= (-1.25d+26)) then
tmp = t_0
else if (y <= (-7.1d-62)) then
tmp = -x
else if (y <= (-5.5d-191)) then
tmp = x / z
else if (y <= 2.1d-209) then
tmp = -x
else if (y <= 1.45d-186) then
tmp = x / z
else if (y <= 1.2d-138) then
tmp = -x
else if (y <= 420000000.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 <= -1.25e+26) {
tmp = t_0;
} else if (y <= -7.1e-62) {
tmp = -x;
} else if (y <= -5.5e-191) {
tmp = x / z;
} else if (y <= 2.1e-209) {
tmp = -x;
} else if (y <= 1.45e-186) {
tmp = x / z;
} else if (y <= 1.2e-138) {
tmp = -x;
} else if (y <= 420000000.0) {
tmp = x / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if y <= -1.25e+26: tmp = t_0 elif y <= -7.1e-62: tmp = -x elif y <= -5.5e-191: tmp = x / z elif y <= 2.1e-209: tmp = -x elif y <= 1.45e-186: tmp = x / z elif y <= 1.2e-138: tmp = -x elif y <= 420000000.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 <= -1.25e+26) tmp = t_0; elseif (y <= -7.1e-62) tmp = Float64(-x); elseif (y <= -5.5e-191) tmp = Float64(x / z); elseif (y <= 2.1e-209) tmp = Float64(-x); elseif (y <= 1.45e-186) tmp = Float64(x / z); elseif (y <= 1.2e-138) tmp = Float64(-x); elseif (y <= 420000000.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 <= -1.25e+26) tmp = t_0; elseif (y <= -7.1e-62) tmp = -x; elseif (y <= -5.5e-191) tmp = x / z; elseif (y <= 2.1e-209) tmp = -x; elseif (y <= 1.45e-186) tmp = x / z; elseif (y <= 1.2e-138) tmp = -x; elseif (y <= 420000000.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, -1.25e+26], t$95$0, If[LessEqual[y, -7.1e-62], (-x), If[LessEqual[y, -5.5e-191], N[(x / z), $MachinePrecision], If[LessEqual[y, 2.1e-209], (-x), If[LessEqual[y, 1.45e-186], N[(x / z), $MachinePrecision], If[LessEqual[y, 1.2e-138], (-x), If[LessEqual[y, 420000000.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 -1.25 \cdot 10^{+26}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -7.1 \cdot 10^{-62}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-191}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-209}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-186}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-138}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 420000000:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.25e26 or 4.2e8 < y Initial program 90.9%
distribute-lft-in90.9%
*-rgt-identity90.9%
Applied egg-rr90.9%
Taylor expanded in y around inf 77.5%
associate-*r/71.4%
Simplified71.4%
if -1.25e26 < y < -7.1000000000000001e-62 or -5.5000000000000001e-191 < y < 2.09999999999999996e-209 or 1.4500000000000001e-186 < y < 1.2e-138Initial program 87.2%
Taylor expanded in z around inf 67.1%
neg-mul-167.1%
Simplified67.1%
if -7.1000000000000001e-62 < y < -5.5000000000000001e-191 or 2.09999999999999996e-209 < y < 1.4500000000000001e-186 or 1.2e-138 < y < 4.2e8Initial program 96.5%
distribute-lft-in96.5%
fma-def96.5%
*-rgt-identity96.5%
Simplified96.5%
Taylor expanded in z around 0 71.2%
Taylor expanded in x around -inf 71.2%
mul-1-neg71.2%
associate-/l*71.2%
distribute-neg-frac71.2%
sub-neg71.2%
neg-mul-171.2%
metadata-eval71.2%
+-commutative71.2%
unsub-neg71.2%
Simplified71.2%
Taylor expanded in y around 0 71.0%
Final simplification70.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= y -1.08e+18)
t_0
(if (<= y -8.5e-62)
(- x)
(if (<= y -5.6e-191)
(/ x z)
(if (<= y 3.2e-209)
(- x)
(if (<= y 8e-187)
(/ x z)
(if (<= y 1.02e-138)
(- x)
(if (<= y 420000000.0) (/ x z) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (y <= -1.08e+18) {
tmp = t_0;
} else if (y <= -8.5e-62) {
tmp = -x;
} else if (y <= -5.6e-191) {
tmp = x / z;
} else if (y <= 3.2e-209) {
tmp = -x;
} else if (y <= 8e-187) {
tmp = x / z;
} else if (y <= 1.02e-138) {
tmp = -x;
} else if (y <= 420000000.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 = y * (x / z)
if (y <= (-1.08d+18)) then
tmp = t_0
else if (y <= (-8.5d-62)) then
tmp = -x
else if (y <= (-5.6d-191)) then
tmp = x / z
else if (y <= 3.2d-209) then
tmp = -x
else if (y <= 8d-187) then
tmp = x / z
else if (y <= 1.02d-138) then
tmp = -x
else if (y <= 420000000.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 = y * (x / z);
double tmp;
if (y <= -1.08e+18) {
tmp = t_0;
} else if (y <= -8.5e-62) {
tmp = -x;
} else if (y <= -5.6e-191) {
tmp = x / z;
} else if (y <= 3.2e-209) {
tmp = -x;
} else if (y <= 8e-187) {
tmp = x / z;
} else if (y <= 1.02e-138) {
tmp = -x;
} else if (y <= 420000000.0) {
tmp = x / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if y <= -1.08e+18: tmp = t_0 elif y <= -8.5e-62: tmp = -x elif y <= -5.6e-191: tmp = x / z elif y <= 3.2e-209: tmp = -x elif y <= 8e-187: tmp = x / z elif y <= 1.02e-138: tmp = -x elif y <= 420000000.0: tmp = x / z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -1.08e+18) tmp = t_0; elseif (y <= -8.5e-62) tmp = Float64(-x); elseif (y <= -5.6e-191) tmp = Float64(x / z); elseif (y <= 3.2e-209) tmp = Float64(-x); elseif (y <= 8e-187) tmp = Float64(x / z); elseif (y <= 1.02e-138) tmp = Float64(-x); elseif (y <= 420000000.0) tmp = Float64(x / z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (y <= -1.08e+18) tmp = t_0; elseif (y <= -8.5e-62) tmp = -x; elseif (y <= -5.6e-191) tmp = x / z; elseif (y <= 3.2e-209) tmp = -x; elseif (y <= 8e-187) tmp = x / z; elseif (y <= 1.02e-138) tmp = -x; elseif (y <= 420000000.0) tmp = x / z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.08e+18], t$95$0, If[LessEqual[y, -8.5e-62], (-x), If[LessEqual[y, -5.6e-191], N[(x / z), $MachinePrecision], If[LessEqual[y, 3.2e-209], (-x), If[LessEqual[y, 8e-187], N[(x / z), $MachinePrecision], If[LessEqual[y, 1.02e-138], (-x), If[LessEqual[y, 420000000.0], N[(x / z), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -1.08 \cdot 10^{+18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-62}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-191}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-209}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-187}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-138}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 420000000:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.08e18 or 4.2e8 < y Initial program 90.3%
Taylor expanded in y around inf 77.1%
associate-/l*72.4%
associate-/r/77.3%
Simplified77.3%
if -1.08e18 < y < -8.4999999999999995e-62 or -5.60000000000000023e-191 < y < 3.2000000000000001e-209 or 8.0000000000000001e-187 < y < 1.02000000000000007e-138Initial program 88.1%
Taylor expanded in z around inf 67.6%
neg-mul-167.6%
Simplified67.6%
if -8.4999999999999995e-62 < y < -5.60000000000000023e-191 or 3.2000000000000001e-209 < y < 8.0000000000000001e-187 or 1.02000000000000007e-138 < y < 4.2e8Initial program 96.5%
distribute-lft-in96.5%
fma-def96.5%
*-rgt-identity96.5%
Simplified96.5%
Taylor expanded in z around 0 71.2%
Taylor expanded in x around -inf 71.2%
mul-1-neg71.2%
associate-/l*71.2%
distribute-neg-frac71.2%
sub-neg71.2%
neg-mul-171.2%
metadata-eval71.2%
+-commutative71.2%
unsub-neg71.2%
Simplified71.2%
Taylor expanded in y around 0 71.0%
Final simplification73.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.5e-19) (not (<= z 2e-31))) (/ x (/ z (+ 1.0 (- y z)))) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.5e-19) || !(z <= 2e-31)) {
tmp = x / (z / (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 <= (-9.5d-19)) .or. (.not. (z <= 2d-31))) then
tmp = x / (z / (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 <= -9.5e-19) || !(z <= 2e-31)) {
tmp = x / (z / (1.0 + (y - z)));
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.5e-19) or not (z <= 2e-31): tmp = x / (z / (1.0 + (y - z))) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.5e-19) || !(z <= 2e-31)) tmp = Float64(x / Float64(z / 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 <= -9.5e-19) || ~((z <= 2e-31))) tmp = x / (z / (1.0 + (y - z))); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.5e-19], N[Not[LessEqual[z, 2e-31]], $MachinePrecision]], N[(x / N[(z / N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-19} \lor \neg \left(z \leq 2 \cdot 10^{-31}\right):\\
\;\;\;\;\frac{x}{\frac{z}{1 + \left(y - z\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -9.4999999999999995e-19 or 2e-31 < z Initial program 82.5%
distribute-lft-in82.5%
*-rgt-identity82.5%
Applied egg-rr82.5%
Taylor expanded in x around 0 82.5%
associate-/l*99.8%
associate--l+99.8%
Simplified99.8%
if -9.4999999999999995e-19 < z < 2e-31Initial program 99.9%
distribute-lft-in99.9%
fma-def99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -1.45e+24) (* x (+ -1.0 (/ y z))) (if (<= z 2e+15) (* (+ 1.0 (- y z)) (/ x z)) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.45e+24) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 2e+15) {
tmp = (1.0 + (y - z)) * (x / 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 <= (-1.45d+24)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 2d+15) then
tmp = (1.0d0 + (y - z)) * (x / 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 <= -1.45e+24) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 2e+15) {
tmp = (1.0 + (y - z)) * (x / z);
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.45e+24: tmp = x * (-1.0 + (y / z)) elif z <= 2e+15: tmp = (1.0 + (y - z)) * (x / z) else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.45e+24) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 2e+15) tmp = Float64(Float64(1.0 + Float64(y - z)) * Float64(x / 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 <= -1.45e+24) tmp = x * (-1.0 + (y / z)); elseif (z <= 2e+15) tmp = (1.0 + (y - z)) * (x / z); else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.45e+24], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+15], N[(N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(y - z\right)\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -1.4499999999999999e24Initial program 80.6%
Taylor expanded in z around 0 93.9%
Taylor expanded in y around inf 93.9%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in x around 0 99.9%
if -1.4499999999999999e24 < z < 2e15Initial program 99.9%
associate-/l*91.4%
associate-/r/99.8%
Applied egg-rr99.8%
if 2e15 < z Initial program 78.3%
Taylor expanded in z around 0 88.1%
Taylor expanded in y around inf 88.1%
associate-*l/93.8%
Simplified93.8%
neg-mul-193.8%
+-commutative93.8%
unsub-neg93.8%
frac-2neg93.8%
associate-/r/99.9%
div-inv99.9%
add-sqr-sqrt43.5%
sqrt-unprod59.3%
sqr-neg59.3%
sqrt-unprod36.7%
add-sqr-sqrt62.7%
clear-num62.7%
add-sqr-sqrt0.0%
sqrt-unprod85.8%
sqr-neg85.8%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 1.0 (- y z))))
(if (<= z -6e+23)
(/ x (/ z t_0))
(if (<= z 0.00135) (/ (* x t_0) z) (- (* x (/ y z)) x)))))
double code(double x, double y, double z) {
double t_0 = 1.0 + (y - z);
double tmp;
if (z <= -6e+23) {
tmp = x / (z / t_0);
} else if (z <= 0.00135) {
tmp = (x * t_0) / 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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y - z)
if (z <= (-6d+23)) then
tmp = x / (z / t_0)
else if (z <= 0.00135d0) then
tmp = (x * t_0) / z
else
tmp = (x * (y / z)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 + (y - z);
double tmp;
if (z <= -6e+23) {
tmp = x / (z / t_0);
} else if (z <= 0.00135) {
tmp = (x * t_0) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 + (y - z) tmp = 0 if z <= -6e+23: tmp = x / (z / t_0) elif z <= 0.00135: tmp = (x * t_0) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) t_0 = Float64(1.0 + Float64(y - z)) tmp = 0.0 if (z <= -6e+23) tmp = Float64(x / Float64(z / t_0)); elseif (z <= 0.00135) tmp = Float64(Float64(x * t_0) / z); else tmp = Float64(Float64(x * Float64(y / z)) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 + (y - z); tmp = 0.0; if (z <= -6e+23) tmp = x / (z / t_0); elseif (z <= 0.00135) tmp = (x * t_0) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+23], N[(x / N[(z / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00135], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y - z\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{\frac{z}{t_0}}\\
\mathbf{elif}\;z \leq 0.00135:\\
\;\;\;\;\frac{x \cdot t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -6.0000000000000002e23Initial program 80.6%
distribute-lft-in80.6%
*-rgt-identity80.6%
Applied egg-rr80.6%
Taylor expanded in x around 0 80.6%
associate-/l*99.9%
associate--l+99.9%
Simplified99.9%
if -6.0000000000000002e23 < z < 0.0013500000000000001Initial program 99.9%
if 0.0013500000000000001 < z Initial program 78.7%
Taylor expanded in z around 0 88.3%
Taylor expanded in y around inf 88.3%
associate-*l/94.0%
Simplified94.0%
neg-mul-194.0%
+-commutative94.0%
unsub-neg94.0%
frac-2neg94.0%
associate-/r/99.9%
div-inv99.8%
add-sqr-sqrt44.7%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod36.0%
add-sqr-sqrt61.4%
clear-num61.4%
add-sqr-sqrt0.0%
sqrt-unprod86.1%
sqr-neg86.1%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.8e+17) (not (<= y 1.0))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.8e+17) || !(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 <= (-3.8d+17)) .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 <= -3.8e+17) || !(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 <= -3.8e+17) 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 <= -3.8e+17) || !(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 <= -3.8e+17) || ~((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, -3.8e+17], 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 -3.8 \cdot 10^{+17} \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 < -3.8e17 or 1 < y Initial program 90.4%
Taylor expanded in z around 0 92.5%
Taylor expanded in y around inf 92.5%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in x around 0 88.4%
if -3.8e17 < y < 1Initial program 91.7%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 98.5%
neg-mul-198.5%
+-commutative98.5%
unsub-neg98.5%
Simplified98.5%
Final simplification93.4%
(FPCore (x y z) :precision binary64 (if (<= y -3.8e+17) (- (* x (/ y z)) x) (if (<= y 1.0) (- (/ x z) x) (* x (+ -1.0 (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+17) {
tmp = (x * (y / z)) - x;
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = x * (-1.0 + (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 <= (-3.8d+17)) then
tmp = (x * (y / z)) - x
else if (y <= 1.0d0) then
tmp = (x / z) - x
else
tmp = x * ((-1.0d0) + (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+17) {
tmp = (x * (y / z)) - x;
} else if (y <= 1.0) {
tmp = (x / z) - x;
} else {
tmp = x * (-1.0 + (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.8e+17: tmp = (x * (y / z)) - x elif y <= 1.0: tmp = (x / z) - x else: tmp = x * (-1.0 + (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.8e+17) tmp = Float64(Float64(x * Float64(y / z)) - x); elseif (y <= 1.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(x * Float64(-1.0 + Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.8e+17) tmp = (x * (y / z)) - x; elseif (y <= 1.0) tmp = (x / z) - x; else tmp = x * (-1.0 + (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.8e+17], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\end{array}
\end{array}
if y < -3.8e17Initial program 90.3%
Taylor expanded in z around 0 93.4%
Taylor expanded in y around inf 93.4%
associate-*l/93.4%
Simplified93.4%
neg-mul-193.4%
+-commutative93.4%
unsub-neg93.4%
frac-2neg93.4%
associate-/r/89.2%
div-inv87.3%
add-sqr-sqrt40.4%
sqrt-unprod39.4%
sqr-neg39.4%
sqrt-unprod13.5%
add-sqr-sqrt19.4%
clear-num19.4%
add-sqr-sqrt12.0%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod40.6%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
if -3.8e17 < y < 1Initial program 91.7%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 98.5%
neg-mul-198.5%
+-commutative98.5%
unsub-neg98.5%
Simplified98.5%
if 1 < y Initial program 90.4%
Taylor expanded in z around 0 91.8%
Taylor expanded in y around inf 91.7%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in x around 0 89.3%
Final simplification93.4%
(FPCore (x y z) :precision binary64 (if (<= z -0.032) (* x (+ -1.0 (/ y z))) (if (<= z 0.00135) (/ x (/ z (+ 1.0 y))) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.032) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 0.00135) {
tmp = x / (z / (1.0 + y));
} 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 <= (-0.032d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 0.00135d0) then
tmp = x / (z / (1.0d0 + y))
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 <= -0.032) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 0.00135) {
tmp = x / (z / (1.0 + y));
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.032: tmp = x * (-1.0 + (y / z)) elif z <= 0.00135: tmp = x / (z / (1.0 + y)) else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.032) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 0.00135) tmp = Float64(x / Float64(z / Float64(1.0 + y))); 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 <= -0.032) tmp = x * (-1.0 + (y / z)); elseif (z <= 0.00135) tmp = x / (z / (1.0 + y)); else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.032], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00135], N[(x / N[(z / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.032:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 0.00135:\\
\;\;\;\;\frac{x}{\frac{z}{1 + y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -0.032000000000000001Initial program 82.8%
Taylor expanded in z around 0 94.6%
Taylor expanded in y around inf 91.9%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in x around 0 97.2%
if -0.032000000000000001 < z < 0.0013500000000000001Initial program 99.9%
distribute-lft-in99.9%
*-rgt-identity99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 99.9%
associate-/l*90.9%
associate--l+90.8%
Simplified90.8%
Taylor expanded in z around 0 98.1%
associate-/l*89.1%
Simplified89.1%
if 0.0013500000000000001 < z Initial program 78.7%
Taylor expanded in z around 0 88.3%
Taylor expanded in y around inf 88.3%
associate-*l/94.0%
Simplified94.0%
neg-mul-194.0%
+-commutative94.0%
unsub-neg94.0%
frac-2neg94.0%
associate-/r/99.9%
div-inv99.8%
add-sqr-sqrt44.7%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod36.0%
add-sqr-sqrt61.4%
clear-num61.4%
add-sqr-sqrt0.0%
sqrt-unprod86.1%
sqr-neg86.1%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification93.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.1) (* x (+ -1.0 (/ y z))) (if (<= z 0.00135) (/ (+ x (* x y)) z) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.1) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 0.00135) {
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 <= (-1.1d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 0.00135d0) 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 <= -1.1) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 0.00135) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.1: tmp = x * (-1.0 + (y / z)) elif z <= 0.00135: tmp = (x + (x * y)) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.1) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 0.00135) 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 <= -1.1) tmp = x * (-1.0 + (y / z)); elseif (z <= 0.00135) tmp = (x + (x * y)) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.1], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00135], 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 -1.1:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 0.00135:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -1.1000000000000001Initial program 82.3%
Taylor expanded in z around 0 94.5%
Taylor expanded in y around inf 92.8%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in x around 0 98.3%
if -1.1000000000000001 < z < 0.0013500000000000001Initial program 99.9%
distribute-lft-in99.9%
fma-def99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 97.5%
if 0.0013500000000000001 < z Initial program 78.7%
Taylor expanded in z around 0 88.3%
Taylor expanded in y around inf 88.3%
associate-*l/94.0%
Simplified94.0%
neg-mul-194.0%
+-commutative94.0%
unsub-neg94.0%
frac-2neg94.0%
associate-/r/99.9%
div-inv99.8%
add-sqr-sqrt44.7%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod36.0%
add-sqr-sqrt61.4%
clear-num61.4%
add-sqr-sqrt0.0%
sqrt-unprod86.1%
sqr-neg86.1%
sqrt-unprod99.8%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (<= x 2.9e-117) (- (/ (* x (+ 1.0 y)) z) x) (/ x (/ z (+ 1.0 (- y z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.9e-117) {
tmp = ((x * (1.0 + y)) / z) - x;
} else {
tmp = x / (z / (1.0 + (y - z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.9d-117) then
tmp = ((x * (1.0d0 + y)) / z) - x
else
tmp = x / (z / (1.0d0 + (y - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.9e-117) {
tmp = ((x * (1.0 + y)) / z) - x;
} else {
tmp = x / (z / (1.0 + (y - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.9e-117: tmp = ((x * (1.0 + y)) / z) - x else: tmp = x / (z / (1.0 + (y - z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.9e-117) tmp = Float64(Float64(Float64(x * Float64(1.0 + y)) / z) - x); else tmp = Float64(x / Float64(z / Float64(1.0 + Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.9e-117) tmp = ((x * (1.0 + y)) / z) - x; else tmp = x / (z / (1.0 + (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.9e-117], N[(N[(N[(x * N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(z / N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{-117}:\\
\;\;\;\;\frac{x \cdot \left(1 + y\right)}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{1 + \left(y - z\right)}}\\
\end{array}
\end{array}
if x < 2.9000000000000001e-117Initial program 95.7%
Taylor expanded in z around 0 98.1%
if 2.9000000000000001e-117 < x Initial program 83.0%
distribute-lft-in83.0%
*-rgt-identity83.0%
Applied egg-rr83.0%
Taylor expanded in x around 0 83.0%
associate-/l*100.0%
associate--l+99.9%
Simplified99.9%
Final simplification98.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.8e+18) (not (<= y 5.1e+42))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.8e+18) || !(y <= 5.1e+42)) {
tmp = y * (x / 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 <= (-2.8d+18)) .or. (.not. (y <= 5.1d+42))) then
tmp = y * (x / 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 <= -2.8e+18) || !(y <= 5.1e+42)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.8e+18) or not (y <= 5.1e+42): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.8e+18) || !(y <= 5.1e+42)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.8e+18) || ~((y <= 5.1e+42))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.8e+18], N[Not[LessEqual[y, 5.1e+42]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+18} \lor \neg \left(y \leq 5.1 \cdot 10^{+42}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.8e18 or 5.0999999999999999e42 < y Initial program 90.4%
Taylor expanded in y around inf 78.7%
associate-/l*74.2%
associate-/r/78.9%
Simplified78.9%
if -2.8e18 < y < 5.0999999999999999e42Initial program 91.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 96.6%
neg-mul-196.6%
+-commutative96.6%
unsub-neg96.6%
Simplified96.6%
Final simplification88.2%
(FPCore (x y z) :precision binary64 (if (<= y -8e+17) (/ y (/ z x)) (if (<= y 4.8e+41) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -8e+17) {
tmp = y / (z / x);
} else if (y <= 4.8e+41) {
tmp = (x / z) - x;
} else {
tmp = y * (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 (y <= (-8d+17)) then
tmp = y / (z / x)
else if (y <= 4.8d+41) then
tmp = (x / z) - x
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -8e+17) {
tmp = y / (z / x);
} else if (y <= 4.8e+41) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8e+17: tmp = y / (z / x) elif y <= 4.8e+41: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8e+17) tmp = Float64(y / Float64(z / x)); elseif (y <= 4.8e+41) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8e+17) tmp = y / (z / x); elseif (y <= 4.8e+41) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8e+17], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+41], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -8e17Initial program 90.3%
Taylor expanded in y around inf 77.1%
associate-/l*68.8%
associate-/r/73.0%
Simplified73.0%
*-commutative73.0%
clear-num73.0%
un-div-inv73.1%
Applied egg-rr73.1%
if -8e17 < y < 4.8000000000000003e41Initial program 91.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 96.6%
neg-mul-196.6%
+-commutative96.6%
unsub-neg96.6%
Simplified96.6%
if 4.8000000000000003e41 < y Initial program 90.6%
Taylor expanded in y around inf 80.4%
associate-/l*79.4%
associate-/r/84.8%
Simplified84.8%
Final simplification88.3%
(FPCore (x y z) :precision binary64 (if (<= y -5.1e+17) (/ (* x y) z) (if (<= y 2.6e+40) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.1e+17) {
tmp = (x * y) / z;
} else if (y <= 2.6e+40) {
tmp = (x / z) - x;
} else {
tmp = y * (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 (y <= (-5.1d+17)) then
tmp = (x * y) / z
else if (y <= 2.6d+40) then
tmp = (x / z) - x
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.1e+17) {
tmp = (x * y) / z;
} else if (y <= 2.6e+40) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.1e+17: tmp = (x * y) / z elif y <= 2.6e+40: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.1e+17) tmp = Float64(Float64(x * y) / z); elseif (y <= 2.6e+40) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.1e+17) tmp = (x * y) / z; elseif (y <= 2.6e+40) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.1e+17], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.6e+40], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+17}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+40}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.1e17Initial program 90.3%
Taylor expanded in y around inf 77.1%
if -5.1e17 < y < 2.6000000000000001e40Initial program 91.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 96.6%
neg-mul-196.6%
+-commutative96.6%
unsub-neg96.6%
Simplified96.6%
if 2.6000000000000001e40 < y Initial program 90.6%
Taylor expanded in y around inf 80.4%
associate-/l*79.4%
associate-/r/84.8%
Simplified84.8%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (<= z -1.0) (- x) (if (<= z 6e+17) (/ x z) (- x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = -x;
} else if (z <= 6e+17) {
tmp = x / z;
} else {
tmp = -x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = -x
else if (z <= 6d+17) then
tmp = x / z
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = -x;
} else if (z <= 6e+17) {
tmp = x / z;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.0: tmp = -x elif z <= 6e+17: tmp = x / z else: tmp = -x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(-x); elseif (z <= 6e+17) tmp = Float64(x / z); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.0) tmp = -x; elseif (z <= 6e+17) tmp = x / z; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.0], (-x), If[LessEqual[z, 6e+17], N[(x / z), $MachinePrecision], (-x)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1 or 6e17 < z Initial program 80.5%
Taylor expanded in z around inf 73.5%
neg-mul-173.5%
Simplified73.5%
if -1 < z < 6e17Initial program 99.9%
distribute-lft-in99.9%
fma-def99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 97.6%
Taylor expanded in x around -inf 97.6%
mul-1-neg97.6%
associate-/l*88.8%
distribute-neg-frac88.8%
sub-neg88.8%
neg-mul-188.8%
metadata-eval88.8%
+-commutative88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in y around 0 53.0%
Final simplification62.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 91.0%
Taylor expanded in z around inf 35.3%
neg-mul-135.3%
Simplified35.3%
Final simplification35.3%
(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 2023290
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(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))