
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * ((y - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * ((y - z) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -2e-54) (not (<= z 1.6e-33))) (* x (+ (/ (+ y 1.0) z) -1.0)) (* (+ (- y z) 1.0) (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2e-54) || !(z <= 1.6e-33)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = ((y - z) + 1.0) * (x / z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2d-54)) .or. (.not. (z <= 1.6d-33))) then
tmp = x * (((y + 1.0d0) / z) + (-1.0d0))
else
tmp = ((y - z) + 1.0d0) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2e-54) || !(z <= 1.6e-33)) {
tmp = x * (((y + 1.0) / z) + -1.0);
} else {
tmp = ((y - z) + 1.0) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2e-54) or not (z <= 1.6e-33): tmp = x * (((y + 1.0) / z) + -1.0) else: tmp = ((y - z) + 1.0) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2e-54) || !(z <= 1.6e-33)) tmp = Float64(x * Float64(Float64(Float64(y + 1.0) / z) + -1.0)); else tmp = Float64(Float64(Float64(y - z) + 1.0) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2e-54) || ~((z <= 1.6e-33))) tmp = x * (((y + 1.0) / z) + -1.0); else tmp = ((y - z) + 1.0) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2e-54], N[Not[LessEqual[z, 1.6e-33]], $MachinePrecision]], N[(x * N[(N[(N[(y + 1.0), $MachinePrecision] / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-54} \lor \neg \left(z \leq 1.6 \cdot 10^{-33}\right):\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z\right) + 1\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -2.0000000000000001e-54 or 1.59999999999999988e-33 < z Initial program 79.4%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
if -2.0000000000000001e-54 < z < 1.59999999999999988e-33Initial program 99.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -3.8e+106)
(- x)
(if (<= z -2.25e-123)
t_0
(if (<= z -2.35e-276)
(/ x z)
(if (<= z 1.6e-169)
t_0
(if (<= z 1e-60) (/ x z) (if (<= z 3.3e+48) t_0 (- x)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -3.8e+106) {
tmp = -x;
} else if (z <= -2.25e-123) {
tmp = t_0;
} else if (z <= -2.35e-276) {
tmp = x / z;
} else if (z <= 1.6e-169) {
tmp = t_0;
} else if (z <= 1e-60) {
tmp = x / z;
} else if (z <= 3.3e+48) {
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 <= (-3.8d+106)) then
tmp = -x
else if (z <= (-2.25d-123)) then
tmp = t_0
else if (z <= (-2.35d-276)) then
tmp = x / z
else if (z <= 1.6d-169) then
tmp = t_0
else if (z <= 1d-60) then
tmp = x / z
else if (z <= 3.3d+48) 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 <= -3.8e+106) {
tmp = -x;
} else if (z <= -2.25e-123) {
tmp = t_0;
} else if (z <= -2.35e-276) {
tmp = x / z;
} else if (z <= 1.6e-169) {
tmp = t_0;
} else if (z <= 1e-60) {
tmp = x / z;
} else if (z <= 3.3e+48) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -3.8e+106: tmp = -x elif z <= -2.25e-123: tmp = t_0 elif z <= -2.35e-276: tmp = x / z elif z <= 1.6e-169: tmp = t_0 elif z <= 1e-60: tmp = x / z elif z <= 3.3e+48: 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 <= -3.8e+106) tmp = Float64(-x); elseif (z <= -2.25e-123) tmp = t_0; elseif (z <= -2.35e-276) tmp = Float64(x / z); elseif (z <= 1.6e-169) tmp = t_0; elseif (z <= 1e-60) tmp = Float64(x / z); elseif (z <= 3.3e+48) 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 <= -3.8e+106) tmp = -x; elseif (z <= -2.25e-123) tmp = t_0; elseif (z <= -2.35e-276) tmp = x / z; elseif (z <= 1.6e-169) tmp = t_0; elseif (z <= 1e-60) tmp = x / z; elseif (z <= 3.3e+48) 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, -3.8e+106], (-x), If[LessEqual[z, -2.25e-123], t$95$0, If[LessEqual[z, -2.35e-276], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.6e-169], t$95$0, If[LessEqual[z, 1e-60], N[(x / z), $MachinePrecision], If[LessEqual[z, 3.3e+48], t$95$0, (-x)]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+106}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-276}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 10^{-60}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+48}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -3.7999999999999998e106 or 3.30000000000000023e48 < z Initial program 70.1%
associate-/l*100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 81.1%
neg-mul-181.1%
Simplified81.1%
if -3.7999999999999998e106 < z < -2.24999999999999997e-123 or -2.34999999999999982e-276 < z < 1.59999999999999997e-169 or 9.9999999999999997e-61 < z < 3.30000000000000023e48Initial program 98.9%
associate-/l*89.5%
+-commutative89.5%
associate-+r-89.5%
div-sub89.5%
*-inverses89.5%
sub-neg89.5%
+-commutative89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in y around inf 60.3%
*-commutative60.3%
associate-*r/62.9%
Simplified62.9%
if -2.24999999999999997e-123 < z < -2.34999999999999982e-276 or 1.59999999999999997e-169 < z < 9.9999999999999997e-61Initial program 99.9%
associate-/l*96.0%
+-commutative96.0%
associate-+r-96.0%
div-sub96.0%
*-inverses96.0%
sub-neg96.0%
+-commutative96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around 0 99.9%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around 0 76.1%
Final simplification72.4%
(FPCore (x y z)
:precision binary64
(if (<= y -1.8e+135)
(/ (* x y) z)
(if (or (<= y -210.0) (not (<= y 1.1e-8)))
(* x (+ -1.0 (/ y z)))
(- (/ x z) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+135) {
tmp = (x * y) / z;
} else if ((y <= -210.0) || !(y <= 1.1e-8)) {
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 <= (-1.8d+135)) then
tmp = (x * y) / z
else if ((y <= (-210.0d0)) .or. (.not. (y <= 1.1d-8))) 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 <= -1.8e+135) {
tmp = (x * y) / z;
} else if ((y <= -210.0) || !(y <= 1.1e-8)) {
tmp = x * (-1.0 + (y / z));
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.8e+135: tmp = (x * y) / z elif (y <= -210.0) or not (y <= 1.1e-8): tmp = x * (-1.0 + (y / z)) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.8e+135) tmp = Float64(Float64(x * y) / z); elseif ((y <= -210.0) || !(y <= 1.1e-8)) 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 <= -1.8e+135) tmp = (x * y) / z; elseif ((y <= -210.0) || ~((y <= 1.1e-8))) tmp = x * (-1.0 + (y / z)); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.8e+135], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[y, -210.0], N[Not[LessEqual[y, 1.1e-8]], $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 -1.8 \cdot 10^{+135}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq -210 \lor \neg \left(y \leq 1.1 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1.7999999999999999e135Initial program 97.2%
associate-/l*83.6%
+-commutative83.6%
associate-+r-83.6%
div-sub83.6%
*-inverses83.6%
sub-neg83.6%
+-commutative83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in y around inf 97.0%
if -1.7999999999999999e135 < y < -210 or 1.0999999999999999e-8 < y Initial program 87.3%
associate-/l*92.1%
+-commutative92.1%
associate-+r-92.1%
div-sub92.1%
*-inverses92.1%
sub-neg92.1%
+-commutative92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in y around inf 90.5%
if -210 < y < 1.0999999999999999e-8Initial program 86.3%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-rgt-in98.8%
associate-*l/99.0%
*-lft-identity99.0%
neg-mul-199.0%
unsub-neg99.0%
Simplified99.0%
Final simplification95.5%
(FPCore (x y z)
:precision binary64
(if (<= y -1.8e+135)
(/ (* x y) z)
(if (<= y -210.0)
(* x (+ -1.0 (/ y z)))
(if (<= y 620000.0) (- (/ x z) x) (* (- y z) (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+135) {
tmp = (x * y) / z;
} else if (y <= -210.0) {
tmp = x * (-1.0 + (y / z));
} else if (y <= 620000.0) {
tmp = (x / z) - x;
} else {
tmp = (y - z) * (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 <= (-1.8d+135)) then
tmp = (x * y) / z
else if (y <= (-210.0d0)) then
tmp = x * ((-1.0d0) + (y / z))
else if (y <= 620000.0d0) then
tmp = (x / z) - x
else
tmp = (y - z) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+135) {
tmp = (x * y) / z;
} else if (y <= -210.0) {
tmp = x * (-1.0 + (y / z));
} else if (y <= 620000.0) {
tmp = (x / z) - x;
} else {
tmp = (y - z) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.8e+135: tmp = (x * y) / z elif y <= -210.0: tmp = x * (-1.0 + (y / z)) elif y <= 620000.0: tmp = (x / z) - x else: tmp = (y - z) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.8e+135) tmp = Float64(Float64(x * y) / z); elseif (y <= -210.0) tmp = Float64(x * Float64(-1.0 + Float64(y / z))); elseif (y <= 620000.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(y - z) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.8e+135) tmp = (x * y) / z; elseif (y <= -210.0) tmp = x * (-1.0 + (y / z)); elseif (y <= 620000.0) tmp = (x / z) - x; else tmp = (y - z) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.8e+135], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -210.0], N[(x * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 620000.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+135}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq -210:\\
\;\;\;\;x \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 620000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -1.7999999999999999e135Initial program 97.2%
associate-/l*83.6%
+-commutative83.6%
associate-+r-83.6%
div-sub83.6%
*-inverses83.6%
sub-neg83.6%
+-commutative83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in y around inf 97.0%
if -1.7999999999999999e135 < y < -210Initial program 93.2%
associate-/l*96.6%
+-commutative96.6%
associate-+r-96.6%
div-sub96.6%
*-inverses96.6%
sub-neg96.6%
+-commutative96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in y around inf 93.3%
if -210 < y < 6.2e5Initial program 85.4%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 98.9%
sub-neg98.9%
metadata-eval98.9%
distribute-rgt-in98.9%
associate-*l/99.0%
*-lft-identity99.0%
neg-mul-199.0%
unsub-neg99.0%
Simplified99.0%
if 6.2e5 < y Initial program 86.5%
associate-/l*89.4%
+-commutative89.4%
associate-+r-89.4%
div-sub89.4%
*-inverses89.4%
sub-neg89.4%
+-commutative89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in y around inf 88.5%
Taylor expanded in z around 0 85.3%
+-commutative85.3%
mul-1-neg85.3%
unsub-neg85.3%
distribute-lft-out--85.6%
Simplified85.6%
*-commutative85.6%
associate-/l*89.3%
Applied egg-rr89.3%
Final simplification95.7%
(FPCore (x y z) :precision binary64 (if (<= z -3.8e+106) (- x) (if (<= z -1.45e-115) (* x (/ y z)) (if (<= z 1.0) (/ x z) (- x)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.8e+106) {
tmp = -x;
} else if (z <= -1.45e-115) {
tmp = x * (y / z);
} else if (z <= 1.0) {
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 <= (-3.8d+106)) then
tmp = -x
else if (z <= (-1.45d-115)) then
tmp = x * (y / z)
else if (z <= 1.0d0) 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 <= -3.8e+106) {
tmp = -x;
} else if (z <= -1.45e-115) {
tmp = x * (y / z);
} else if (z <= 1.0) {
tmp = x / z;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.8e+106: tmp = -x elif z <= -1.45e-115: tmp = x * (y / z) elif z <= 1.0: tmp = x / z else: tmp = -x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.8e+106) tmp = Float64(-x); elseif (z <= -1.45e-115) tmp = Float64(x * Float64(y / z)); elseif (z <= 1.0) tmp = Float64(x / z); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.8e+106) tmp = -x; elseif (z <= -1.45e-115) tmp = x * (y / z); elseif (z <= 1.0) tmp = x / z; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.8e+106], (-x), If[LessEqual[z, -1.45e-115], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x / z), $MachinePrecision], (-x)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+106}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-115}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -3.7999999999999998e106 or 1 < z Initial program 72.6%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 77.1%
neg-mul-177.1%
Simplified77.1%
if -3.7999999999999998e106 < z < -1.4499999999999999e-115Initial program 97.8%
associate-/l*95.8%
+-commutative95.8%
associate-+r-95.8%
div-sub95.8%
*-inverses95.8%
sub-neg95.8%
+-commutative95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in y around inf 64.7%
associate-/l*60.8%
Simplified60.8%
if -1.4499999999999999e-115 < z < 1Initial program 99.8%
associate-/l*88.8%
+-commutative88.8%
associate-+r-88.8%
div-sub88.8%
*-inverses88.8%
sub-neg88.8%
+-commutative88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in z around 0 99.7%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in y around 0 61.3%
Final simplification67.8%
(FPCore (x y z) :precision binary64 (if (<= y -210.0) (/ (* x (- y z)) z) (if (<= y 240000.0) (- (/ x z) x) (* (- y z) (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -210.0) {
tmp = (x * (y - z)) / z;
} else if (y <= 240000.0) {
tmp = (x / z) - x;
} else {
tmp = (y - z) * (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 <= (-210.0d0)) then
tmp = (x * (y - z)) / z
else if (y <= 240000.0d0) then
tmp = (x / z) - x
else
tmp = (y - z) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -210.0) {
tmp = (x * (y - z)) / z;
} else if (y <= 240000.0) {
tmp = (x / z) - x;
} else {
tmp = (y - z) * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -210.0: tmp = (x * (y - z)) / z elif y <= 240000.0: tmp = (x / z) - x else: tmp = (y - z) * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -210.0) tmp = Float64(Float64(x * Float64(y - z)) / z); elseif (y <= 240000.0) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(y - z) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -210.0) tmp = (x * (y - z)) / z; elseif (y <= 240000.0) tmp = (x / z) - x; else tmp = (y - z) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -210.0], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 240000.0], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -210:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{z}\\
\mathbf{elif}\;y \leq 240000:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -210Initial program 95.3%
associate-/l*89.6%
+-commutative89.6%
associate-+r-89.6%
div-sub89.6%
*-inverses89.6%
sub-neg89.6%
+-commutative89.6%
metadata-eval89.6%
Simplified89.6%
Taylor expanded in y around inf 88.0%
Taylor expanded in z around 0 93.7%
+-commutative93.7%
mul-1-neg93.7%
unsub-neg93.7%
distribute-lft-out--93.8%
Simplified93.8%
if -210 < y < 2.4e5Initial program 85.4%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.8%
*-inverses99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 98.9%
sub-neg98.9%
metadata-eval98.9%
distribute-rgt-in98.9%
associate-*l/99.0%
*-lft-identity99.0%
neg-mul-199.0%
unsub-neg99.0%
Simplified99.0%
if 2.4e5 < y Initial program 86.5%
associate-/l*89.4%
+-commutative89.4%
associate-+r-89.4%
div-sub89.4%
*-inverses89.4%
sub-neg89.4%
+-commutative89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in y around inf 88.5%
Taylor expanded in z around 0 85.3%
+-commutative85.3%
mul-1-neg85.3%
unsub-neg85.3%
distribute-lft-out--85.6%
Simplified85.6%
*-commutative85.6%
associate-/l*89.3%
Applied egg-rr89.3%
Final simplification95.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.7e+82) (not (<= y 3.4e+37))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.7e+82) || !(y <= 3.4e+37)) {
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.7d+82)) .or. (.not. (y <= 3.4d+37))) 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.7e+82) || !(y <= 3.4e+37)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.7e+82) or not (y <= 3.4e+37): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.7e+82) || !(y <= 3.4e+37)) 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.7e+82) || ~((y <= 3.4e+37))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.7e+82], N[Not[LessEqual[y, 3.4e+37]], $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.7 \cdot 10^{+82} \lor \neg \left(y \leq 3.4 \cdot 10^{+37}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -2.6999999999999999e82 or 3.40000000000000006e37 < y Initial program 90.1%
associate-/l*88.3%
+-commutative88.3%
associate-+r-88.3%
div-sub88.3%
*-inverses88.3%
sub-neg88.3%
+-commutative88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in y around inf 80.8%
*-commutative80.8%
associate-*r/79.8%
Simplified79.8%
if -2.6999999999999999e82 < y < 3.40000000000000006e37Initial program 86.7%
associate-/l*99.2%
+-commutative99.2%
associate-+r-99.2%
div-sub99.2%
*-inverses99.2%
sub-neg99.2%
+-commutative99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 92.7%
sub-neg92.7%
metadata-eval92.7%
distribute-rgt-in92.7%
associate-*l/92.9%
*-lft-identity92.9%
neg-mul-192.9%
unsub-neg92.9%
Simplified92.9%
Final simplification87.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.35e+82) (/ y (/ z x)) (if (<= y 3.5e+35) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.35e+82) {
tmp = y / (z / x);
} else if (y <= 3.5e+35) {
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 <= (-1.35d+82)) then
tmp = y / (z / x)
else if (y <= 3.5d+35) 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 <= -1.35e+82) {
tmp = y / (z / x);
} else if (y <= 3.5e+35) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.35e+82: tmp = y / (z / x) elif y <= 3.5e+35: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.35e+82) tmp = Float64(y / Float64(z / x)); elseif (y <= 3.5e+35) 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 <= -1.35e+82) tmp = y / (z / x); elseif (y <= 3.5e+35) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.35e+82], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+35], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -1.35e82Initial program 93.7%
associate-/l*87.9%
+-commutative87.9%
associate-+r-87.9%
div-sub87.9%
*-inverses87.9%
sub-neg87.9%
+-commutative87.9%
metadata-eval87.9%
Simplified87.9%
Taylor expanded in y around inf 87.4%
*-commutative87.4%
associate-*r/81.9%
Simplified81.9%
clear-num81.8%
un-div-inv82.0%
Applied egg-rr82.0%
if -1.35e82 < y < 3.5000000000000001e35Initial program 86.7%
associate-/l*99.2%
+-commutative99.2%
associate-+r-99.2%
div-sub99.2%
*-inverses99.2%
sub-neg99.2%
+-commutative99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 92.7%
sub-neg92.7%
metadata-eval92.7%
distribute-rgt-in92.7%
associate-*l/92.9%
*-lft-identity92.9%
neg-mul-192.9%
unsub-neg92.9%
Simplified92.9%
if 3.5000000000000001e35 < y Initial program 87.2%
associate-/l*88.7%
+-commutative88.7%
associate-+r-88.7%
div-sub88.7%
*-inverses88.7%
sub-neg88.7%
+-commutative88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in y around inf 75.7%
*-commutative75.7%
associate-*r/78.3%
Simplified78.3%
Final simplification87.6%
(FPCore (x y z) :precision binary64 (if (<= y -5.5e+46) (/ (* x y) z) (if (<= y 1.6e+39) (- (/ x z) x) (* y (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.5e+46) {
tmp = (x * y) / z;
} else if (y <= 1.6e+39) {
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.5d+46)) then
tmp = (x * y) / z
else if (y <= 1.6d+39) 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.5e+46) {
tmp = (x * y) / z;
} else if (y <= 1.6e+39) {
tmp = (x / z) - x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.5e+46: tmp = (x * y) / z elif y <= 1.6e+39: tmp = (x / z) - x else: tmp = y * (x / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.5e+46) tmp = Float64(Float64(x * y) / z); elseif (y <= 1.6e+39) 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.5e+46) tmp = (x * y) / z; elseif (y <= 1.6e+39) tmp = (x / z) - x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.5e+46], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 1.6e+39], 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.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.4999999999999998e46Initial program 94.6%
associate-/l*87.8%
+-commutative87.8%
associate-+r-87.8%
div-sub87.8%
*-inverses87.8%
sub-neg87.8%
+-commutative87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in y around inf 82.2%
if -5.4999999999999998e46 < y < 1.59999999999999996e39Initial program 86.0%
associate-/l*99.8%
+-commutative99.8%
associate-+r-99.8%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 95.0%
sub-neg95.0%
metadata-eval95.0%
distribute-rgt-in95.0%
associate-*l/95.2%
*-lft-identity95.2%
neg-mul-195.2%
unsub-neg95.2%
Simplified95.2%
if 1.59999999999999996e39 < y Initial program 87.2%
associate-/l*88.7%
+-commutative88.7%
associate-+r-88.7%
div-sub88.7%
*-inverses88.7%
sub-neg88.7%
+-commutative88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in y around inf 75.7%
*-commutative75.7%
associate-*r/78.3%
Simplified78.3%
Final simplification88.5%
(FPCore (x y z) :precision binary64 (if (<= y -1e+133) (/ (* x (- y z)) z) (* x (+ (/ (+ y 1.0) z) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1e+133) {
tmp = (x * (y - z)) / 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 (y <= (-1d+133)) then
tmp = (x * (y - z)) / 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 (y <= -1e+133) {
tmp = (x * (y - z)) / z;
} else {
tmp = x * (((y + 1.0) / z) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1e+133: tmp = (x * (y - z)) / z else: tmp = x * (((y + 1.0) / z) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1e+133) tmp = Float64(Float64(x * Float64(y - z)) / 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 (y <= -1e+133) tmp = (x * (y - z)) / z; else tmp = x * (((y + 1.0) / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1e+133], N[(N[(x * N[(y - z), $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}\;y \leq -1 \cdot 10^{+133}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y + 1}{z} + -1\right)\\
\end{array}
\end{array}
if y < -1e133Initial program 97.2%
associate-/l*83.6%
+-commutative83.6%
associate-+r-83.6%
div-sub83.6%
*-inverses83.6%
sub-neg83.6%
+-commutative83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in y around inf 83.6%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
mul-1-neg97.0%
unsub-neg97.0%
distribute-lft-out--97.2%
Simplified97.2%
if -1e133 < y Initial program 86.7%
associate-/l*96.4%
+-commutative96.4%
associate-+r-96.4%
div-sub96.5%
*-inverses96.5%
sub-neg96.5%
+-commutative96.5%
metadata-eval96.5%
Simplified96.5%
Final simplification96.6%
(FPCore (x y z) :precision binary64 (if (<= x 100.0) (/ (* 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 <= 100.0) {
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 <= 100.0d0) 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 <= 100.0) {
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 <= 100.0: 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 <= 100.0) 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 <= 100.0) 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, 100.0], 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 100:\\
\;\;\;\;\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 < 100Initial program 90.4%
if 100 < x Initial program 80.1%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub99.9%
*-inverses99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification92.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (- x) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(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 <= (-1.0d0)) .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 <= -1.0) || !(z <= 1.0)) {
tmp = -x;
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = -x else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(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 <= -1.0) || ~((z <= 1.0))) tmp = -x; else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], (-x), N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;-x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 75.8%
associate-/l*99.9%
+-commutative99.9%
associate-+r-99.9%
div-sub100.0%
*-inverses100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 68.7%
neg-mul-168.7%
Simplified68.7%
if -1 < z < 1Initial program 99.8%
associate-/l*89.8%
+-commutative89.8%
associate-+r-89.8%
div-sub89.8%
*-inverses89.8%
sub-neg89.8%
+-commutative89.8%
metadata-eval89.8%
Simplified89.8%
Taylor expanded in z around 0 99.2%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in y around 0 56.0%
Final simplification62.2%
(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 88.1%
associate-/l*94.7%
+-commutative94.7%
associate-+r-94.7%
div-sub94.8%
*-inverses94.8%
sub-neg94.8%
+-commutative94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in z around inf 35.2%
neg-mul-135.2%
Simplified35.2%
Final simplification35.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 2024115
(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))