
(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 15 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 -7.6e-13) (not (<= z 1e-40))) (* x (+ (/ (+ y 1.0) z) -1.0)) (/ (+ x (* x y)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.6e-13) || !(z <= 1e-40)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} 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 <= (-7.6d-13)) .or. (.not. (z <= 1d-40))) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
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 <= -7.6e-13) || !(z <= 1e-40)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = (x + (x * y)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.6e-13) or not (z <= 1e-40): tmp = x * (((y + 1.0) / z) + -1.0) else: tmp = (x + (x * y)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.6e-13) || !(z <= 1e-40)) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); 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 <= -7.6e-13) || ~((z <= 1e-40))) tmp = x * (((y + 1.0) / z) + -1.0); else tmp = (x + (x * y)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.6e-13], N[Not[LessEqual[z, 1e-40]], $MachinePrecision]], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-13} \lor \neg \left(z \leq 10^{-40}\right):\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\end{array}
\end{array}
if z < -7.5999999999999999e-13 or 9.9999999999999993e-41 < z Initial program 80.0%
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 -7.5999999999999999e-13 < z < 9.9999999999999993e-41Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= x 1.15e-73) (/ (fma x (- y z) x) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.15e-73) {
tmp = fma(x, (y - z), x) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.15e-73) tmp = Float64(fma(x, Float64(y - z), x) / z); else tmp = Float64(Float64(x / Float64(z / Float64(y + 1.0))) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.15e-73], N[(N[(x * N[(y - z), $MachinePrecision] + x), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{-73}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y - z, x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}} - x\\
\end{array}
\end{array}
if x < 1.14999999999999994e-73Initial program 91.9%
distribute-lft-in91.9%
fma-define91.9%
*-rgt-identity91.9%
Simplified91.9%
if 1.14999999999999994e-73 < x Initial program 83.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%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification94.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -2.75e+32)
(- x)
(if (<= z -3.8e-71)
t_0
(if (<= z -1.05e-298) (/ x z) (if (<= z 1.7e+69) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -2.75e+32) {
tmp = -x;
} else if (z <= -3.8e-71) {
tmp = t_0;
} else if (z <= -1.05e-298) {
tmp = x / z;
} else if (z <= 1.7e+69) {
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 = y * (x / z)
if (z <= (-2.75d+32)) then
tmp = -x
else if (z <= (-3.8d-71)) then
tmp = t_0
else if (z <= (-1.05d-298)) then
tmp = x / z
else if (z <= 1.7d+69) 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 = y * (x / z);
double tmp;
if (z <= -2.75e+32) {
tmp = -x;
} else if (z <= -3.8e-71) {
tmp = t_0;
} else if (z <= -1.05e-298) {
tmp = x / z;
} else if (z <= 1.7e+69) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -2.75e+32: tmp = -x elif z <= -3.8e-71: tmp = t_0 elif z <= -1.05e-298: tmp = x / z elif z <= 1.7e+69: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -2.75e+32) tmp = Float64(-x); elseif (z <= -3.8e-71) tmp = t_0; elseif (z <= -1.05e-298) tmp = Float64(x / z); elseif (z <= 1.7e+69) tmp = t_0; 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.75e+32) tmp = -x; elseif (z <= -3.8e-71) tmp = t_0; elseif (z <= -1.05e-298) tmp = x / z; elseif (z <= 1.7e+69) tmp = t_0; 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.75e+32], (-x), If[LessEqual[z, -3.8e-71], t$95$0, If[LessEqual[z, -1.05e-298], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.7e+69], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -2.75 \cdot 10^{+32}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-71}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-298}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+69}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -2.74999999999999992e32 or 1.69999999999999993e69 < z Initial program 76.8%
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 82.7%
neg-mul-182.7%
Simplified82.7%
if -2.74999999999999992e32 < z < -3.79999999999999992e-71 or -1.05000000000000002e-298 < z < 1.69999999999999993e69Initial program 98.2%
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 59.2%
*-commutative59.2%
associate-*r/63.3%
Simplified63.3%
if -3.79999999999999992e-71 < z < -1.05000000000000002e-298Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 70.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ y z))))
(if (<= z -5e+30)
(- x)
(if (<= z -7.6e-72)
t_0
(if (<= z 1.16e-112) (/ x z) (if (<= z 4.2e+71) t_0 (- x)))))))
double code(double x, double y, double z) {
double t_0 = x * (y / z);
double tmp;
if (z <= -5e+30) {
tmp = -x;
} else if (z <= -7.6e-72) {
tmp = t_0;
} else if (z <= 1.16e-112) {
tmp = x / z;
} else if (z <= 4.2e+71) {
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 <= (-5d+30)) then
tmp = -x
else if (z <= (-7.6d-72)) then
tmp = t_0
else if (z <= 1.16d-112) then
tmp = x / z
else if (z <= 4.2d+71) 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 <= -5e+30) {
tmp = -x;
} else if (z <= -7.6e-72) {
tmp = t_0;
} else if (z <= 1.16e-112) {
tmp = x / z;
} else if (z <= 4.2e+71) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y / z) tmp = 0 if z <= -5e+30: tmp = -x elif z <= -7.6e-72: tmp = t_0 elif z <= 1.16e-112: tmp = x / z elif z <= 4.2e+71: 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 <= -5e+30) tmp = Float64(-x); elseif (z <= -7.6e-72) tmp = t_0; elseif (z <= 1.16e-112) tmp = Float64(x / z); elseif (z <= 4.2e+71) 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 <= -5e+30) tmp = -x; elseif (z <= -7.6e-72) tmp = t_0; elseif (z <= 1.16e-112) tmp = x / z; elseif (z <= 4.2e+71) 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, -5e+30], (-x), If[LessEqual[z, -7.6e-72], t$95$0, If[LessEqual[z, 1.16e-112], N[(x / z), $MachinePrecision], If[LessEqual[z, 4.2e+71], t$95$0, (-x)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+30}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-72}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+71}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -4.9999999999999998e30 or 4.19999999999999978e71 < z Initial program 76.8%
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 82.7%
neg-mul-182.7%
Simplified82.7%
if -4.9999999999999998e30 < z < -7.60000000000000004e-72 or 1.16000000000000002e-112 < z < 4.19999999999999978e71Initial program 96.7%
associate-/l*98.1%
+-commutative98.1%
associate-+r-98.1%
div-sub98.1%
*-inverses98.1%
sub-neg98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in y around inf 60.4%
associate-/l*61.8%
Simplified61.8%
if -7.60000000000000004e-72 < z < 1.16000000000000002e-112Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 66.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -2200000000000.0) (not (<= y 3.8e-26))) (- (/ (* x y) z) x) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2200000000000.0) || !(y <= 3.8e-26)) {
tmp = ((x * y) / z) - x;
} 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 <= (-2200000000000.0d0)) .or. (.not. (y <= 3.8d-26))) then
tmp = ((x * y) / z) - x
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 <= -2200000000000.0) || !(y <= 3.8e-26)) {
tmp = ((x * y) / z) - x;
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2200000000000.0) or not (y <= 3.8e-26): tmp = ((x * y) / z) - x else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2200000000000.0) || !(y <= 3.8e-26)) tmp = Float64(Float64(Float64(x * y) / z) - x); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2200000000000.0) || ~((y <= 3.8e-26))) tmp = ((x * y) / z) - x; else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2200000000000.0], N[Not[LessEqual[y, 3.8e-26]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2200000000000 \lor \neg \left(y \leq 3.8 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{x \cdot y}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.2e12 or 3.80000000000000015e-26 < y Initial program 90.5%
associate-/l*89.2%
+-commutative89.2%
associate-+r-89.2%
div-sub89.2%
*-inverses89.2%
sub-neg89.2%
metadata-eval89.2%
+-commutative89.2%
Simplified89.2%
distribute-lft-in89.2%
clear-num89.1%
un-div-inv89.3%
*-commutative89.3%
mul-1-neg89.3%
Applied egg-rr89.3%
Taylor expanded in y around inf 92.8%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in y around 0 92.8%
if -2.2e12 < y < 3.80000000000000015e-26Initial program 88.0%
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.2%
sub-neg99.2%
metadata-eval99.2%
distribute-rgt-in99.2%
associate-*l/99.4%
*-lft-identity99.4%
neg-mul-199.4%
unsub-neg99.4%
Simplified99.4%
Final simplification96.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -2200000000000.0) (not (<= y 3.8e-26))) (* x (+ -1.0 (/ y z))) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2200000000000.0) || !(y <= 3.8e-26)) {
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 <= (-2200000000000.0d0)) .or. (.not. (y <= 3.8d-26))) 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 <= -2200000000000.0) || !(y <= 3.8e-26)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2200000000000.0) or not (y <= 3.8e-26): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2200000000000.0) || !(y <= 3.8e-26)) 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 <= -2200000000000.0) || ~((y <= 3.8e-26))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2200000000000.0], N[Not[LessEqual[y, 3.8e-26]], $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 -2200000000000 \lor \neg \left(y \leq 3.8 \cdot 10^{-26}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.2e12 or 3.80000000000000015e-26 < y Initial program 90.5%
associate-/l*89.2%
+-commutative89.2%
associate-+r-89.2%
div-sub89.2%
*-inverses89.2%
sub-neg89.2%
metadata-eval89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in y around inf 88.7%
if -2.2e12 < y < 3.80000000000000015e-26Initial program 88.0%
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.2%
sub-neg99.2%
metadata-eval99.2%
distribute-rgt-in99.2%
associate-*l/99.4%
*-lft-identity99.4%
neg-mul-199.4%
unsub-neg99.4%
Simplified99.4%
Final simplification93.9%
(FPCore (x y z) :precision binary64 (if (<= z -0.98) (* x (+ -1.0 (/ y z))) (if (<= z 1.3e-5) (/ (+ x (* x y)) z) (- (* x (/ y z)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.98) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 1.3e-5) {
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 <= (-0.98d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (z <= 1.3d-5) 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 <= -0.98) {
tmp = x * (-1.0 + (y / z));
} else if (z <= 1.3e-5) {
tmp = (x + (x * y)) / z;
} else {
tmp = (x * (y / z)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.98: tmp = x * (-1.0 + (y / z)) elif z <= 1.3e-5: tmp = (x + (x * y)) / z else: tmp = (x * (y / z)) - x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.98) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (z <= 1.3e-5) 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 <= -0.98) tmp = x * (-1.0 + (y / z)); elseif (z <= 1.3e-5) tmp = (x + (x * y)) / z; else tmp = (x * (y / z)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.98], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-5], 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 -0.98:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-5}:\\
\;\;\;\;\frac{x + x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\end{array}
\end{array}
if z < -0.97999999999999998Initial program 80.0%
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 98.7%
if -0.97999999999999998 < z < 1.29999999999999992e-5Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.0%
if 1.29999999999999992e-5 < z Initial program 78.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%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 89.3%
associate-*r/97.7%
Simplified97.7%
unsub-neg97.7%
Applied egg-rr97.7%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (<= y -2200000000000.0) (- (* x (/ y z)) x) (if (<= y 3.8e-26) (- (/ x z) x) (* x (+ -1.0 (/ y z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2200000000000.0) {
tmp = (x * (y / z)) - x;
} else if (y <= 3.8e-26) {
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 <= (-2200000000000.0d0)) then
tmp = (x * (y / z)) - x
else if (y <= 3.8d-26) 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 <= -2200000000000.0) {
tmp = (x * (y / z)) - x;
} else if (y <= 3.8e-26) {
tmp = (x / z) - x;
} else {
tmp = x * (-1.0 + (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2200000000000.0: tmp = (x * (y / z)) - x elif y <= 3.8e-26: tmp = (x / z) - x else: tmp = x * (-1.0 + (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2200000000000.0) tmp = Float64(Float64(x * Float64(y / z)) - x); elseif (y <= 3.8e-26) 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 <= -2200000000000.0) tmp = (x * (y / z)) - x; elseif (y <= 3.8e-26) tmp = (x / z) - x; else tmp = x * (-1.0 + (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2200000000000.0], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 3.8e-26], 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 -2200000000000:\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\end{array}
\end{array}
if y < -2.2e12Initial program 89.6%
associate-/l*85.9%
+-commutative85.9%
associate-+r-85.9%
div-sub85.9%
*-inverses85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
distribute-lft-in85.9%
clear-num85.8%
un-div-inv86.3%
*-commutative86.3%
mul-1-neg86.3%
Applied egg-rr86.3%
Taylor expanded in y around inf 91.2%
associate-*r/85.9%
Simplified85.9%
unsub-neg85.9%
Applied egg-rr85.9%
if -2.2e12 < y < 3.80000000000000015e-26Initial program 88.0%
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.2%
sub-neg99.2%
metadata-eval99.2%
distribute-rgt-in99.2%
associate-*l/99.4%
*-lft-identity99.4%
neg-mul-199.4%
unsub-neg99.4%
Simplified99.4%
if 3.80000000000000015e-26 < y Initial program 91.2%
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 90.7%
Final simplification93.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.2e+16) (not (<= y 5.2e+60))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2e+16) || !(y <= 5.2e+60)) {
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 <= (-3.2d+16)) .or. (.not. (y <= 5.2d+60))) 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 <= -3.2e+16) || !(y <= 5.2e+60)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.2e+16) or not (y <= 5.2e+60): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.2e+16) || !(y <= 5.2e+60)) 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 <= -3.2e+16) || ~((y <= 5.2e+60))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.2e+16], N[Not[LessEqual[y, 5.2e+60]], $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 -3.2 \cdot 10^{+16} \lor \neg \left(y \leq 5.2 \cdot 10^{+60}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -3.2e16 or 5.20000000000000016e60 < y Initial program 91.7%
associate-/l*87.7%
+-commutative87.7%
associate-+r-87.7%
div-sub87.7%
*-inverses87.7%
sub-neg87.7%
metadata-eval87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in y around inf 75.3%
*-commutative75.3%
associate-*r/74.3%
Simplified74.3%
if -3.2e16 < y < 5.20000000000000016e60Initial program 87.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 98.0%
sub-neg98.0%
metadata-eval98.0%
distribute-rgt-in98.0%
associate-*l/98.2%
*-lft-identity98.2%
neg-mul-198.2%
unsub-neg98.2%
Simplified98.2%
Final simplification87.4%
(FPCore (x y z) :precision binary64 (if (<= y -6.9e+16) (/ y (/ z x)) (if (<= y 1.55e+60) (- (/ x z) x) (/ (* x y) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.9e+16) {
tmp = y / (z / x);
} else if (y <= 1.55e+60) {
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 <= (-6.9d+16)) then
tmp = y / (z / x)
else if (y <= 1.55d+60) 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 <= -6.9e+16) {
tmp = y / (z / x);
} else if (y <= 1.55e+60) {
tmp = (x / z) - x;
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.9e+16: tmp = y / (z / x) elif y <= 1.55e+60: tmp = (x / z) - x else: tmp = (x * y) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.9e+16) tmp = Float64(y / Float64(z / x)); elseif (y <= 1.55e+60) 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 <= -6.9e+16) tmp = y / (z / x); elseif (y <= 1.55e+60) tmp = (x / z) - x; else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.9e+16], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+60], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.9 \cdot 10^{+16}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+60}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if y < -6.9e16Initial program 89.6%
associate-/l*85.9%
+-commutative85.9%
associate-+r-85.9%
div-sub85.9%
*-inverses85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in y around inf 70.8%
*-commutative70.8%
associate-*r/72.3%
Simplified72.3%
clear-num72.3%
un-div-inv72.4%
Applied egg-rr72.4%
if -6.9e16 < y < 1.55e60Initial program 87.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 98.0%
sub-neg98.0%
metadata-eval98.0%
distribute-rgt-in98.0%
associate-*l/98.2%
*-lft-identity98.2%
neg-mul-198.2%
unsub-neg98.2%
Simplified98.2%
if 1.55e60 < y Initial program 93.6%
associate-/l*89.3%
+-commutative89.3%
associate-+r-89.3%
div-sub89.3%
*-inverses89.3%
sub-neg89.3%
metadata-eval89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in y around inf 79.3%
(FPCore (x y z) :precision binary64 (if (<= y -69000000000000.0) (/ y (/ z x)) (if (<= y 9.2e+60) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -69000000000000.0) {
tmp = y / (z / x);
} else if (y <= 9.2e+60) {
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 <= (-69000000000000.0d0)) then
tmp = y / (z / x)
else if (y <= 9.2d+60) 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 <= -69000000000000.0) {
tmp = y / (z / x);
} else if (y <= 9.2e+60) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -69000000000000.0: tmp = y / (z / x) elif y <= 9.2e+60: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -69000000000000.0) tmp = Float64(y / Float64(z / x)); elseif (y <= 9.2e+60) 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 <= -69000000000000.0) tmp = y / (z / x); elseif (y <= 9.2e+60) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -69000000000000.0], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e+60], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -69000000000000:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+60}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -6.9e13Initial program 89.6%
associate-/l*85.9%
+-commutative85.9%
associate-+r-85.9%
div-sub85.9%
*-inverses85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in y around inf 70.8%
*-commutative70.8%
associate-*r/72.3%
Simplified72.3%
clear-num72.3%
un-div-inv72.4%
Applied egg-rr72.4%
if -6.9e13 < y < 9.20000000000000068e60Initial program 87.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 98.0%
sub-neg98.0%
metadata-eval98.0%
distribute-rgt-in98.0%
associate-*l/98.2%
*-lft-identity98.2%
neg-mul-198.2%
unsub-neg98.2%
Simplified98.2%
if 9.20000000000000068e60 < y Initial program 93.6%
associate-/l*89.3%
+-commutative89.3%
associate-+r-89.3%
div-sub89.3%
*-inverses89.3%
sub-neg89.3%
metadata-eval89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in y around inf 79.3%
*-commutative79.3%
associate-*r/76.0%
Simplified76.0%
(FPCore (x y z) :precision binary64 (if (<= x 8e-73) (/ (* x (+ (- y z) 1.0)) z) (- (/ x (/ z (+ y 1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 8e-73) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = (x / (z / (y + 1.0))) - 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 (x <= 8d-73) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = (x / (z / (y + 1.0d0))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 8e-73) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = (x / (z / (y + 1.0))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 8e-73: tmp = (x * ((y - z) + 1.0)) / z else: tmp = (x / (z / (y + 1.0))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 8e-73) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(Float64(x / Float64(z / Float64(y + 1.0))) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 8e-73) tmp = (x * ((y - z) + 1.0)) / z; else tmp = (x / (z / (y + 1.0))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 8e-73], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[(z / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{-73}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + 1}} - x\\
\end{array}
\end{array}
if x < 7.99999999999999998e-73Initial program 91.9%
if 7.99999999999999998e-73 < x Initial program 83.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%
distribute-lft-in99.9%
clear-num99.9%
un-div-inv99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Final simplification94.4%
(FPCore (x y z) :precision binary64 (if (<= x 2e-19) (/ (* x (+ (- y z) 1.0)) z) (* x (+ (/ (+ y 1.0) z) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e-19) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -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 (x <= 2d-19) then
tmp = (x * ((y - z) + 1.0d0)) / z
else
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2e-19) {
tmp = (x * ((y - z) + 1.0)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2e-19: tmp = (x * ((y - z) + 1.0)) / z else: tmp = x * (((y + 1.0) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2e-19) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z); else tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2e-19) tmp = (x * ((y - z) + 1.0)) / z; else tmp = x * (((y + 1.0) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2e-19], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{-19}:\\
\;\;\;\;\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\end{array}
\end{array}
if x < 2e-19Initial program 92.4%
if 2e-19 < x Initial program 80.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%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.7) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7) || !(z <= 1.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 <= (-3.7d0)) .or. (.not. (z <= 1.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 <= -3.7) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.7) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.7) || !(z <= 1.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 <= -3.7) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.7], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -3.7000000000000002 or 1 < z Initial program 78.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 z around inf 75.6%
neg-mul-175.6%
Simplified75.6%
if -3.7000000000000002 < z < 1Initial program 99.9%
distribute-lft-in99.9%
fma-define99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in z around 0 99.0%
Taylor expanded in y around 0 57.8%
Final simplification66.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 89.3%
associate-/l*94.4%
+-commutative94.4%
associate-+r-94.4%
div-sub94.4%
*-inverses94.4%
sub-neg94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in z around inf 39.2%
neg-mul-139.2%
Simplified39.2%
(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 2024095
(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))