
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 85.8%
Taylor expanded in t around 0 99.5%
sub-neg99.5%
metadata-eval99.5%
associate-*r/99.5%
+-commutative99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
associate-/l/99.5%
metadata-eval99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*r/99.5%
distribute-rgt-out99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
expm1-log1p-u42.1%
expm1-udef42.1%
associate-*l/42.1%
*-un-lft-identity42.1%
Applied egg-rr42.1%
expm1-def42.1%
expm1-log1p99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (/ 2.0 (* z t))) (t_3 (+ (/ x y) -2.0)))
(if (<= t -3.3e-12)
t_3
(if (<= t -1.16e-48)
t_1
(if (<= t -7.5e-194)
t_2
(if (<= t -4.5e-250) t_1 (if (<= t 0.00092) t_2 t_3)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = 2.0 / (z * t);
double t_3 = (x / y) + -2.0;
double tmp;
if (t <= -3.3e-12) {
tmp = t_3;
} else if (t <= -1.16e-48) {
tmp = t_1;
} else if (t <= -7.5e-194) {
tmp = t_2;
} else if (t <= -4.5e-250) {
tmp = t_1;
} else if (t <= 0.00092) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = 2.0d0 / (z * t)
t_3 = (x / y) + (-2.0d0)
if (t <= (-3.3d-12)) then
tmp = t_3
else if (t <= (-1.16d-48)) then
tmp = t_1
else if (t <= (-7.5d-194)) then
tmp = t_2
else if (t <= (-4.5d-250)) then
tmp = t_1
else if (t <= 0.00092d0) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = 2.0 / (z * t);
double t_3 = (x / y) + -2.0;
double tmp;
if (t <= -3.3e-12) {
tmp = t_3;
} else if (t <= -1.16e-48) {
tmp = t_1;
} else if (t <= -7.5e-194) {
tmp = t_2;
} else if (t <= -4.5e-250) {
tmp = t_1;
} else if (t <= 0.00092) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = 2.0 / (z * t) t_3 = (x / y) + -2.0 tmp = 0 if t <= -3.3e-12: tmp = t_3 elif t <= -1.16e-48: tmp = t_1 elif t <= -7.5e-194: tmp = t_2 elif t <= -4.5e-250: tmp = t_1 elif t <= 0.00092: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) t_2 = Float64(2.0 / Float64(z * t)) t_3 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -3.3e-12) tmp = t_3; elseif (t <= -1.16e-48) tmp = t_1; elseif (t <= -7.5e-194) tmp = t_2; elseif (t <= -4.5e-250) tmp = t_1; elseif (t <= 0.00092) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); t_2 = 2.0 / (z * t); t_3 = (x / y) + -2.0; tmp = 0.0; if (t <= -3.3e-12) tmp = t_3; elseif (t <= -1.16e-48) tmp = t_1; elseif (t <= -7.5e-194) tmp = t_2; elseif (t <= -4.5e-250) tmp = t_1; elseif (t <= 0.00092) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -3.3e-12], t$95$3, If[LessEqual[t, -1.16e-48], t$95$1, If[LessEqual[t, -7.5e-194], t$95$2, If[LessEqual[t, -4.5e-250], t$95$1, If[LessEqual[t, 0.00092], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{2}{z \cdot t}\\
t_3 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-12}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.16 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-250}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 0.00092:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -3.3000000000000001e-12 or 9.2000000000000003e-4 < t Initial program 75.4%
Taylor expanded in t around inf 87.9%
if -3.3000000000000001e-12 < t < -1.16e-48 or -7.4999999999999998e-194 < t < -4.49999999999999993e-250Initial program 99.7%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 87.2%
sub-neg87.2%
associate-*r/87.2%
metadata-eval87.2%
associate-/r*87.2%
metadata-eval87.2%
associate-*r/87.2%
associate-*l/87.2%
distribute-rgt-out87.2%
metadata-eval87.2%
Simplified87.2%
Taylor expanded in z around inf 77.4%
if -1.16e-48 < t < -7.4999999999999998e-194 or -4.49999999999999993e-250 < t < 9.2000000000000003e-4Initial program 98.7%
Taylor expanded in t around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
associate-*r/98.8%
+-commutative98.8%
associate-*r/98.8%
metadata-eval98.8%
metadata-eval98.8%
+-commutative98.8%
associate-/l/98.8%
metadata-eval98.8%
associate-*r/98.8%
*-rgt-identity98.8%
associate-*r/98.8%
distribute-rgt-out98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in z around 0 55.8%
Final simplification74.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (+ (/ x y) -2.0)))
(if (<= t -3.4e-15)
t_2
(if (<= t -5.2e-49)
t_1
(if (<= t -1.9e-197)
(/ 2.0 (* z t))
(if (<= t -2.15e-249) t_1 (if (<= t 0.013) (/ (/ 2.0 t) z) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -3.4e-15) {
tmp = t_2;
} else if (t <= -5.2e-49) {
tmp = t_1;
} else if (t <= -1.9e-197) {
tmp = 2.0 / (z * t);
} else if (t <= -2.15e-249) {
tmp = t_1;
} else if (t <= 0.013) {
tmp = (2.0 / t) / z;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = (x / y) + (-2.0d0)
if (t <= (-3.4d-15)) then
tmp = t_2
else if (t <= (-5.2d-49)) then
tmp = t_1
else if (t <= (-1.9d-197)) then
tmp = 2.0d0 / (z * t)
else if (t <= (-2.15d-249)) then
tmp = t_1
else if (t <= 0.013d0) then
tmp = (2.0d0 / t) / z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -3.4e-15) {
tmp = t_2;
} else if (t <= -5.2e-49) {
tmp = t_1;
} else if (t <= -1.9e-197) {
tmp = 2.0 / (z * t);
} else if (t <= -2.15e-249) {
tmp = t_1;
} else if (t <= 0.013) {
tmp = (2.0 / t) / z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = (x / y) + -2.0 tmp = 0 if t <= -3.4e-15: tmp = t_2 elif t <= -5.2e-49: tmp = t_1 elif t <= -1.9e-197: tmp = 2.0 / (z * t) elif t <= -2.15e-249: tmp = t_1 elif t <= 0.013: tmp = (2.0 / t) / z else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -3.4e-15) tmp = t_2; elseif (t <= -5.2e-49) tmp = t_1; elseif (t <= -1.9e-197) tmp = Float64(2.0 / Float64(z * t)); elseif (t <= -2.15e-249) tmp = t_1; elseif (t <= 0.013) tmp = Float64(Float64(2.0 / t) / z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); t_2 = (x / y) + -2.0; tmp = 0.0; if (t <= -3.4e-15) tmp = t_2; elseif (t <= -5.2e-49) tmp = t_1; elseif (t <= -1.9e-197) tmp = 2.0 / (z * t); elseif (t <= -2.15e-249) tmp = t_1; elseif (t <= 0.013) tmp = (2.0 / t) / z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -3.4e-15], t$95$2, If[LessEqual[t, -5.2e-49], t$95$1, If[LessEqual[t, -1.9e-197], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.15e-249], t$95$1, If[LessEqual[t, 0.013], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-197}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;t \leq -2.15 \cdot 10^{-249}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 0.013:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.4e-15 or 0.0129999999999999994 < t Initial program 75.4%
Taylor expanded in t around inf 87.9%
if -3.4e-15 < t < -5.1999999999999999e-49 or -1.8999999999999999e-197 < t < -2.1500000000000001e-249Initial program 99.7%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 87.2%
sub-neg87.2%
associate-*r/87.2%
metadata-eval87.2%
associate-/r*87.2%
metadata-eval87.2%
associate-*r/87.2%
associate-*l/87.2%
distribute-rgt-out87.2%
metadata-eval87.2%
Simplified87.2%
Taylor expanded in z around inf 77.4%
if -5.1999999999999999e-49 < t < -1.8999999999999999e-197Initial program 96.0%
Taylor expanded in t around 0 96.0%
sub-neg96.0%
metadata-eval96.0%
associate-*r/96.0%
+-commutative96.0%
associate-*r/96.0%
metadata-eval96.0%
metadata-eval96.0%
+-commutative96.0%
associate-/l/96.1%
metadata-eval96.1%
associate-*r/96.1%
*-rgt-identity96.1%
associate-*r/96.1%
distribute-rgt-out96.2%
associate-*r/96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in z around 0 63.2%
if -2.1500000000000001e-249 < t < 0.0129999999999999994Initial program 99.8%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u67.3%
expm1-udef67.3%
associate-*l/67.3%
*-un-lft-identity67.3%
Applied egg-rr67.3%
expm1-def67.3%
expm1-log1p99.9%
Simplified99.9%
Taylor expanded in z around 0 52.8%
associate-/r*52.9%
Simplified52.9%
Final simplification74.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (+ (/ x y) -2.0)))
(if (<= t -7.5e-13)
t_2
(if (<= t -3.05e-49)
t_1
(if (<= t -5.8e-198)
(* (/ 2.0 t) (/ 1.0 z))
(if (<= t -6.5e-253) t_1 (if (<= t 0.00048) (/ (/ 2.0 t) z) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -7.5e-13) {
tmp = t_2;
} else if (t <= -3.05e-49) {
tmp = t_1;
} else if (t <= -5.8e-198) {
tmp = (2.0 / t) * (1.0 / z);
} else if (t <= -6.5e-253) {
tmp = t_1;
} else if (t <= 0.00048) {
tmp = (2.0 / t) / z;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = (x / y) + (-2.0d0)
if (t <= (-7.5d-13)) then
tmp = t_2
else if (t <= (-3.05d-49)) then
tmp = t_1
else if (t <= (-5.8d-198)) then
tmp = (2.0d0 / t) * (1.0d0 / z)
else if (t <= (-6.5d-253)) then
tmp = t_1
else if (t <= 0.00048d0) then
tmp = (2.0d0 / t) / z
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double t_2 = (x / y) + -2.0;
double tmp;
if (t <= -7.5e-13) {
tmp = t_2;
} else if (t <= -3.05e-49) {
tmp = t_1;
} else if (t <= -5.8e-198) {
tmp = (2.0 / t) * (1.0 / z);
} else if (t <= -6.5e-253) {
tmp = t_1;
} else if (t <= 0.00048) {
tmp = (2.0 / t) / z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = (x / y) + -2.0 tmp = 0 if t <= -7.5e-13: tmp = t_2 elif t <= -3.05e-49: tmp = t_1 elif t <= -5.8e-198: tmp = (2.0 / t) * (1.0 / z) elif t <= -6.5e-253: tmp = t_1 elif t <= 0.00048: tmp = (2.0 / t) / z else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) + -2.0) tmp = 0.0 if (t <= -7.5e-13) tmp = t_2; elseif (t <= -3.05e-49) tmp = t_1; elseif (t <= -5.8e-198) tmp = Float64(Float64(2.0 / t) * Float64(1.0 / z)); elseif (t <= -6.5e-253) tmp = t_1; elseif (t <= 0.00048) tmp = Float64(Float64(2.0 / t) / z); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / t); t_2 = (x / y) + -2.0; tmp = 0.0; if (t <= -7.5e-13) tmp = t_2; elseif (t <= -3.05e-49) tmp = t_1; elseif (t <= -5.8e-198) tmp = (2.0 / t) * (1.0 / z); elseif (t <= -6.5e-253) tmp = t_1; elseif (t <= 0.00048) tmp = (2.0 / t) / z; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[t, -7.5e-13], t$95$2, If[LessEqual[t, -3.05e-49], t$95$1, If[LessEqual[t, -5.8e-198], N[(N[(2.0 / t), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -6.5e-253], t$95$1, If[LessEqual[t, 0.00048], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-13}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.05 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-198}:\\
\;\;\;\;\frac{2}{t} \cdot \frac{1}{z}\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 0.00048:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -7.5000000000000004e-13 or 4.80000000000000012e-4 < t Initial program 75.4%
Taylor expanded in t around inf 87.9%
if -7.5000000000000004e-13 < t < -3.04999999999999982e-49 or -5.80000000000000001e-198 < t < -6.4999999999999998e-253Initial program 99.7%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 87.2%
sub-neg87.2%
associate-*r/87.2%
metadata-eval87.2%
associate-/r*87.2%
metadata-eval87.2%
associate-*r/87.2%
associate-*l/87.2%
distribute-rgt-out87.2%
metadata-eval87.2%
Simplified87.2%
Taylor expanded in z around inf 77.4%
if -3.04999999999999982e-49 < t < -5.80000000000000001e-198Initial program 96.0%
Taylor expanded in t around 0 96.0%
sub-neg96.0%
metadata-eval96.0%
associate-*r/96.0%
+-commutative96.0%
associate-*r/96.0%
metadata-eval96.0%
metadata-eval96.0%
+-commutative96.0%
associate-/l/96.1%
metadata-eval96.1%
associate-*r/96.1%
*-rgt-identity96.1%
associate-*r/96.1%
distribute-rgt-out96.2%
associate-*r/96.2%
metadata-eval96.2%
Simplified96.2%
expm1-log1p-u50.6%
expm1-udef50.6%
associate-*l/50.6%
*-un-lft-identity50.6%
Applied egg-rr50.6%
expm1-def50.6%
expm1-log1p96.2%
Simplified96.2%
Taylor expanded in z around 0 63.2%
associate-/r*63.2%
Simplified63.2%
div-inv63.3%
Applied egg-rr63.3%
if -6.4999999999999998e-253 < t < 4.80000000000000012e-4Initial program 99.8%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u67.3%
expm1-udef67.3%
associate-*l/67.3%
*-un-lft-identity67.3%
Applied egg-rr67.3%
expm1-def67.3%
expm1-log1p99.9%
Simplified99.9%
Taylor expanded in z around 0 52.8%
associate-/r*52.9%
Simplified52.9%
Final simplification74.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+19) (not (<= (/ x y) 2.65e+50))) (+ (/ x y) (/ (/ 2.0 t) z)) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+19) || !((x / y) <= 2.65e+50)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-5d+19)) .or. (.not. ((x / y) <= 2.65d+50))) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+19) || !((x / y) <= 2.65e+50)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+19) or not ((x / y) <= 2.65e+50): tmp = (x / y) + ((2.0 / t) / z) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+19) || !(Float64(x / y) <= 2.65e+50)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e+19) || ~(((x / y) <= 2.65e+50))) tmp = (x / y) + ((2.0 / t) / z); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+19], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.65e+50]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+19} \lor \neg \left(\frac{x}{y} \leq 2.65 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -5e19 or 2.6500000000000001e50 < (/.f64 x y) Initial program 87.4%
Taylor expanded in z around 0 93.9%
associate-/r*93.9%
Simplified93.9%
if -5e19 < (/.f64 x y) < 2.6500000000000001e50Initial program 84.6%
Taylor expanded in t around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
associate-*r/99.8%
+-commutative99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
associate-/l/99.8%
metadata-eval99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
expm1-log1p-u34.8%
expm1-udef34.8%
associate-*l/34.8%
*-un-lft-identity34.8%
Applied egg-rr34.8%
expm1-def34.8%
expm1-log1p99.9%
Simplified99.9%
Taylor expanded in x around 0 96.5%
associate--l+96.5%
associate-*r/96.5%
metadata-eval96.5%
associate-*r/96.5%
metadata-eval96.5%
associate-/r*96.5%
sub-neg96.5%
metadata-eval96.5%
associate-*r/96.5%
associate-*l/96.5%
*-commutative96.5%
metadata-eval96.5%
associate-+l+96.5%
metadata-eval96.5%
associate-*l/96.5%
distribute-lft-in96.5%
associate-*l/96.5%
associate-*r/96.5%
*-lft-identity96.5%
Simplified96.5%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -7.2e+19) (/ x y) (if (<= (/ x y) 8.4e+80) (+ -2.0 (/ 2.0 (* z t))) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -7.2e+19) {
tmp = x / y;
} else if ((x / y) <= 8.4e+80) {
tmp = -2.0 + (2.0 / (z * t));
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-7.2d+19)) then
tmp = x / y
else if ((x / y) <= 8.4d+80) then
tmp = (-2.0d0) + (2.0d0 / (z * t))
else
tmp = (x / y) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -7.2e+19) {
tmp = x / y;
} else if ((x / y) <= 8.4e+80) {
tmp = -2.0 + (2.0 / (z * t));
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -7.2e+19: tmp = x / y elif (x / y) <= 8.4e+80: tmp = -2.0 + (2.0 / (z * t)) else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -7.2e+19) tmp = Float64(x / y); elseif (Float64(x / y) <= 8.4e+80) tmp = Float64(-2.0 + Float64(2.0 / Float64(z * t))); else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -7.2e+19) tmp = x / y; elseif ((x / y) <= 8.4e+80) tmp = -2.0 + (2.0 / (z * t)); else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -7.2e+19], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 8.4e+80], N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -7.2 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 8.4 \cdot 10^{+80}:\\
\;\;\;\;-2 + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -7.2e19Initial program 87.2%
Taylor expanded in x around inf 78.8%
if -7.2e19 < (/.f64 x y) < 8.40000000000000005e80Initial program 85.2%
+-commutative85.2%
remove-double-neg85.2%
distribute-frac-neg85.2%
unsub-neg85.2%
*-commutative85.2%
associate-*r*85.2%
distribute-rgt1-in85.2%
associate-*r/87.0%
/-rgt-identity87.0%
fma-neg87.0%
/-rgt-identity87.0%
*-commutative87.0%
fma-def87.0%
*-commutative87.0%
distribute-frac-neg87.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in t around 0 99.8%
Taylor expanded in z around 0 75.2%
if 8.40000000000000005e80 < (/.f64 x y) Initial program 86.2%
Taylor expanded in t around inf 90.8%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2.1e+16) (not (<= (/ x y) 2.65e+50))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.1e+16) || !((x / y) <= 2.65e+50)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-2.1d+16)) .or. (.not. ((x / y) <= 2.65d+50))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2.1e+16) || !((x / y) <= 2.65e+50)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2.1e+16) or not ((x / y) <= 2.65e+50): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -2.1e+16) || !(Float64(x / y) <= 2.65e+50)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -2.1e+16) || ~(((x / y) <= 2.65e+50))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -2.1e+16], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.65e+50]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.1 \cdot 10^{+16} \lor \neg \left(\frac{x}{y} \leq 2.65 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.1e16 or 2.6500000000000001e50 < (/.f64 x y) Initial program 87.5%
Taylor expanded in x around inf 80.4%
if -2.1e16 < (/.f64 x y) < 2.6500000000000001e50Initial program 84.5%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 96.5%
sub-neg96.5%
associate-*r/96.5%
metadata-eval96.5%
associate-/r*96.5%
metadata-eval96.5%
associate-*r/96.5%
associate-*l/96.5%
distribute-rgt-out96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in z around inf 58.4%
Final simplification68.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4.2e-6) (not (<= (/ x y) 4e-14))) (+ (/ x y) -2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4.2e-6) || !((x / y) <= 4e-14)) {
tmp = (x / y) + -2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-4.2d-6)) .or. (.not. ((x / y) <= 4d-14))) then
tmp = (x / y) + (-2.0d0)
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4.2e-6) || !((x / y) <= 4e-14)) {
tmp = (x / y) + -2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4.2e-6) or not ((x / y) <= 4e-14): tmp = (x / y) + -2.0 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -4.2e-6) || !(Float64(x / y) <= 4e-14)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -4.2e-6) || ~(((x / y) <= 4e-14))) tmp = (x / y) + -2.0; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4.2e-6], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e-14]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4.2 \cdot 10^{-6} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.1999999999999996e-6 or 4e-14 < (/.f64 x y) Initial program 88.9%
Taylor expanded in t around inf 75.8%
if -4.1999999999999996e-6 < (/.f64 x y) < 4e-14Initial program 82.8%
Taylor expanded in t around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l/99.9%
metadata-eval99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
distribute-rgt-out99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
associate-*l/99.9%
distribute-rgt-out99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 61.6%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.9e-31) (not (<= z 2.3e-86))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e-31) || !(z <= 2.3e-86)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.9d-31)) .or. (.not. (z <= 2.3d-86))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + (2.0d0 / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e-31) || !(z <= 2.3e-86)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.9e-31) or not (z <= 2.3e-86): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.9e-31) || !(z <= 2.3e-86)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.9e-31) || ~((z <= 2.3e-86))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.9e-31], N[Not[LessEqual[z, 2.3e-86]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-31} \lor \neg \left(z \leq 2.3 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -3.9000000000000001e-31 or 2.29999999999999996e-86 < z Initial program 76.1%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 94.2%
sub-neg94.2%
+-commutative94.2%
metadata-eval94.2%
associate-+l+94.2%
associate-*r/94.2%
metadata-eval94.2%
Simplified94.2%
if -3.9000000000000001e-31 < z < 2.29999999999999996e-86Initial program 98.9%
Taylor expanded in z around 0 89.2%
Final simplification92.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.82e-29) (not (<= z 2.3e-86))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.82e-29) || !(z <= 2.3e-86)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.82d-29)) .or. (.not. (z <= 2.3d-86))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.82e-29) || !(z <= 2.3e-86)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.82e-29) or not (z <= 2.3e-86): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.82e-29) || !(z <= 2.3e-86)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.82e-29) || ~((z <= 2.3e-86))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.82e-29], N[Not[LessEqual[z, 2.3e-86]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.82 \cdot 10^{-29} \lor \neg \left(z \leq 2.3 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -1.81999999999999987e-29 or 2.29999999999999996e-86 < z Initial program 76.1%
Taylor expanded in t around 0 100.0%
sub-neg100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
associate-/l/100.0%
metadata-eval100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
distribute-rgt-out100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 94.2%
sub-neg94.2%
+-commutative94.2%
metadata-eval94.2%
associate-+l+94.2%
associate-*r/94.2%
metadata-eval94.2%
Simplified94.2%
if -1.81999999999999987e-29 < z < 2.29999999999999996e-86Initial program 98.9%
Taylor expanded in z around 0 89.2%
associate-/r*89.3%
Simplified89.3%
Final simplification92.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -6.6e-8) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.6e-8) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-6.6d-8)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = x / y
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -6.6e-8) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -6.6e-8) or not ((x / y) <= 2.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -6.6e-8) || !(Float64(x / y) <= 2.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -6.6e-8) || ~(((x / y) <= 2.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -6.6e-8], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6.6 \cdot 10^{-8} \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -6.59999999999999954e-8 or 2 < (/.f64 x y) Initial program 88.8%
Taylor expanded in x around inf 73.8%
if -6.59999999999999954e-8 < (/.f64 x y) < 2Initial program 82.9%
+-commutative82.9%
remove-double-neg82.9%
distribute-frac-neg82.9%
unsub-neg82.9%
*-commutative82.9%
associate-*r*82.9%
distribute-rgt1-in82.9%
associate-*r/85.1%
/-rgt-identity85.1%
fma-neg85.1%
/-rgt-identity85.1%
*-commutative85.1%
fma-def85.1%
*-commutative85.1%
distribute-frac-neg85.1%
remove-double-neg85.1%
Simplified85.1%
Taylor expanded in x around 0 84.8%
Taylor expanded in t around inf 41.3%
Final simplification57.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e-9) (not (<= t 0.035))) (+ (/ x y) -2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e-9) || !(t <= 0.035)) {
tmp = (x / y) + -2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.55d-9)) .or. (.not. (t <= 0.035d0))) then
tmp = (x / y) + (-2.0d0)
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e-9) || !(t <= 0.035)) {
tmp = (x / y) + -2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.55e-9) or not (t <= 0.035): tmp = (x / y) + -2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.55e-9) || !(t <= 0.035)) tmp = Float64(Float64(x / y) + -2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.55e-9) || ~((t <= 0.035))) tmp = (x / y) + -2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.55e-9], N[Not[LessEqual[t, 0.035]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{-9} \lor \neg \left(t \leq 0.035\right):\\
\;\;\;\;\frac{x}{y} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.55000000000000002e-9 or 0.035000000000000003 < t Initial program 75.0%
Taylor expanded in t around inf 88.4%
if -1.55000000000000002e-9 < t < 0.035000000000000003Initial program 98.9%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (<= t -7.5e-68) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (if (<= t 0.043) (/ (+ 2.0 (/ 2.0 z)) t) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.5e-68) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else if (t <= 0.043) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-7.5d-68)) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else if (t <= 0.043d0) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else
tmp = (x / y) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.5e-68) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else if (t <= 0.043) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7.5e-68: tmp = (x / y) + (-2.0 + (2.0 / t)) elif t <= 0.043: tmp = (2.0 + (2.0 / z)) / t else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7.5e-68) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); elseif (t <= 0.043) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); else tmp = Float64(Float64(x / y) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -7.5e-68) tmp = (x / y) + (-2.0 + (2.0 / t)); elseif (t <= 0.043) tmp = (2.0 + (2.0 / z)) / t; else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.5e-68], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.043], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{elif}\;t \leq 0.043:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if t < -7.50000000000000081e-68Initial program 81.3%
Taylor expanded in t around 0 98.7%
sub-neg98.7%
metadata-eval98.7%
associate-*r/98.7%
+-commutative98.7%
associate-*r/98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
associate-/l/98.7%
metadata-eval98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*r/98.7%
distribute-rgt-out98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in z around inf 82.1%
sub-neg82.1%
+-commutative82.1%
metadata-eval82.1%
associate-+l+82.1%
associate-*r/82.1%
metadata-eval82.1%
Simplified82.1%
if -7.50000000000000081e-68 < t < 0.042999999999999997Initial program 99.7%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
metadata-eval83.2%
Simplified83.2%
if 0.042999999999999997 < t Initial program 72.6%
Taylor expanded in t around inf 90.8%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 85.8%
+-commutative85.8%
remove-double-neg85.8%
distribute-frac-neg85.8%
unsub-neg85.8%
*-commutative85.8%
associate-*r*85.8%
distribute-rgt1-in85.8%
associate-*r/87.3%
/-rgt-identity87.3%
fma-neg87.3%
/-rgt-identity87.3%
*-commutative87.3%
fma-def87.3%
*-commutative87.3%
distribute-frac-neg87.3%
remove-double-neg87.3%
Simplified87.3%
Taylor expanded in x around 0 56.2%
Taylor expanded in t around inf 22.3%
Final simplification22.3%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024019
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))