
(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 (fma x (/ 1.0 y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return fma(x, (1.0 / y), (-2.0 + ((2.0 + (2.0 / z)) / t)));
}
function code(x, y, z, t) return fma(x, Float64(1.0 / y), Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
code[x_, y_, z_, t_] := N[(x * N[(1.0 / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \frac{1}{y}, -2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 82.6%
sub-neg82.6%
distribute-rgt-in82.6%
*-lft-identity82.6%
associate-+r+82.6%
cancel-sign-sub-inv82.6%
div-sub71.7%
associate-*r*71.7%
associate-*l/71.7%
*-inverses98.7%
metadata-eval98.7%
sub-neg98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
metadata-eval98.7%
associate-/l/98.7%
Simplified98.7%
div-inv98.6%
fma-def99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (- (/ x y) 2.0)))
(if (<= z -1.4e+182)
t_2
(if (<= z -180000000000.0)
t_1
(if (<= z -5.7e-108)
t_2
(if (<= z 3.7e-93)
(/ 2.0 (* z t))
(if (or (<= z 1.9e+64) (not (<= z 1.25e+163))) t_2 t_1)))))))
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 (z <= -1.4e+182) {
tmp = t_2;
} else if (z <= -180000000000.0) {
tmp = t_1;
} else if (z <= -5.7e-108) {
tmp = t_2;
} else if (z <= 3.7e-93) {
tmp = 2.0 / (z * t);
} else if ((z <= 1.9e+64) || !(z <= 1.25e+163)) {
tmp = t_2;
} else {
tmp = t_1;
}
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 (z <= (-1.4d+182)) then
tmp = t_2
else if (z <= (-180000000000.0d0)) then
tmp = t_1
else if (z <= (-5.7d-108)) then
tmp = t_2
else if (z <= 3.7d-93) then
tmp = 2.0d0 / (z * t)
else if ((z <= 1.9d+64) .or. (.not. (z <= 1.25d+163))) then
tmp = t_2
else
tmp = t_1
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 (z <= -1.4e+182) {
tmp = t_2;
} else if (z <= -180000000000.0) {
tmp = t_1;
} else if (z <= -5.7e-108) {
tmp = t_2;
} else if (z <= 3.7e-93) {
tmp = 2.0 / (z * t);
} else if ((z <= 1.9e+64) || !(z <= 1.25e+163)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = (x / y) - 2.0 tmp = 0 if z <= -1.4e+182: tmp = t_2 elif z <= -180000000000.0: tmp = t_1 elif z <= -5.7e-108: tmp = t_2 elif z <= 3.7e-93: tmp = 2.0 / (z * t) elif (z <= 1.9e+64) or not (z <= 1.25e+163): tmp = t_2 else: tmp = t_1 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 (z <= -1.4e+182) tmp = t_2; elseif (z <= -180000000000.0) tmp = t_1; elseif (z <= -5.7e-108) tmp = t_2; elseif (z <= 3.7e-93) tmp = Float64(2.0 / Float64(z * t)); elseif ((z <= 1.9e+64) || !(z <= 1.25e+163)) tmp = t_2; else tmp = t_1; 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 (z <= -1.4e+182) tmp = t_2; elseif (z <= -180000000000.0) tmp = t_1; elseif (z <= -5.7e-108) tmp = t_2; elseif (z <= 3.7e-93) tmp = 2.0 / (z * t); elseif ((z <= 1.9e+64) || ~((z <= 1.25e+163))) tmp = t_2; else tmp = t_1; 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[z, -1.4e+182], t$95$2, If[LessEqual[z, -180000000000.0], t$95$1, If[LessEqual[z, -5.7e-108], t$95$2, If[LessEqual[z, 3.7e-93], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.9e+64], N[Not[LessEqual[z, 1.25e+163]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+182}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -180000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.7 \cdot 10^{-108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-93}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+64} \lor \neg \left(z \leq 1.25 \cdot 10^{+163}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.40000000000000003e182 or -1.8e11 < z < -5.7e-108 or 3.70000000000000002e-93 < z < 1.9000000000000001e64 or 1.25e163 < z Initial program 69.6%
sub-neg69.6%
distribute-rgt-in69.6%
*-lft-identity69.6%
associate-+r+69.6%
cancel-sign-sub-inv69.6%
div-sub69.6%
associate-*r*69.6%
associate-*l/69.6%
*-inverses98.9%
metadata-eval98.9%
sub-neg98.9%
metadata-eval98.9%
metadata-eval98.9%
+-commutative98.9%
metadata-eval98.9%
associate-/l/99.0%
Simplified99.0%
Taylor expanded in t around inf 70.4%
if -1.40000000000000003e182 < z < -1.8e11 or 1.9000000000000001e64 < z < 1.25e163Initial program 84.5%
sub-neg84.5%
distribute-rgt-in84.5%
*-lft-identity84.5%
associate-+r+84.5%
cancel-sign-sub-inv84.5%
div-sub84.5%
associate-*r*84.5%
associate-*l/84.5%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 83.3%
associate--l+83.3%
associate-*r/83.3%
metadata-eval83.3%
associate-*r/83.3%
metadata-eval83.3%
Simplified83.3%
Taylor expanded in z around inf 83.3%
sub-neg83.3%
associate-*r/83.3%
metadata-eval83.3%
metadata-eval83.3%
Simplified83.3%
if -5.7e-108 < z < 3.70000000000000002e-93Initial program 97.6%
sub-neg97.6%
distribute-rgt-in97.6%
*-lft-identity97.6%
associate-+r+97.6%
cancel-sign-sub-inv97.6%
div-sub65.8%
associate-*r*65.8%
associate-*l/65.8%
*-inverses97.6%
metadata-eval97.6%
sub-neg97.6%
metadata-eval97.6%
metadata-eval97.6%
+-commutative97.6%
metadata-eval97.6%
associate-/l/97.6%
Simplified97.6%
Taylor expanded in z around 0 74.9%
Final simplification74.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ (/ x y) (/ 2.0 t))))
(if (<= z -1.8e+182)
t_2
(if (<= z -160000000000.0)
(+ -2.0 (/ 2.0 t))
(if (<= z -6.6e-108)
t_1
(if (<= z 1.25e-25) (/ (/ 2.0 z) t) (if (<= z 5e+164) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = (x / y) + (2.0 / t);
double tmp;
if (z <= -1.8e+182) {
tmp = t_2;
} else if (z <= -160000000000.0) {
tmp = -2.0 + (2.0 / t);
} else if (z <= -6.6e-108) {
tmp = t_1;
} else if (z <= 1.25e-25) {
tmp = (2.0 / z) / t;
} else if (z <= 5e+164) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = (x / y) - 2.0d0
t_2 = (x / y) + (2.0d0 / t)
if (z <= (-1.8d+182)) then
tmp = t_2
else if (z <= (-160000000000.0d0)) then
tmp = (-2.0d0) + (2.0d0 / t)
else if (z <= (-6.6d-108)) then
tmp = t_1
else if (z <= 1.25d-25) then
tmp = (2.0d0 / z) / t
else if (z <= 5d+164) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = (x / y) + (2.0 / t);
double tmp;
if (z <= -1.8e+182) {
tmp = t_2;
} else if (z <= -160000000000.0) {
tmp = -2.0 + (2.0 / t);
} else if (z <= -6.6e-108) {
tmp = t_1;
} else if (z <= 1.25e-25) {
tmp = (2.0 / z) / t;
} else if (z <= 5e+164) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = (x / y) + (2.0 / t) tmp = 0 if z <= -1.8e+182: tmp = t_2 elif z <= -160000000000.0: tmp = -2.0 + (2.0 / t) elif z <= -6.6e-108: tmp = t_1 elif z <= 1.25e-25: tmp = (2.0 / z) / t elif z <= 5e+164: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.8e+182) tmp = t_2; elseif (z <= -160000000000.0) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (z <= -6.6e-108) tmp = t_1; elseif (z <= 1.25e-25) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= 5e+164) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = (x / y) + (2.0 / t); tmp = 0.0; if (z <= -1.8e+182) tmp = t_2; elseif (z <= -160000000000.0) tmp = -2.0 + (2.0 / t); elseif (z <= -6.6e-108) tmp = t_1; elseif (z <= 1.25e-25) tmp = (2.0 / z) / t; elseif (z <= 5e+164) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+182], t$95$2, If[LessEqual[z, -160000000000.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.6e-108], t$95$1, If[LessEqual[z, 1.25e-25], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5e+164], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+182}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -160000000000:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-25}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+164}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.8e182 or 1.2499999999999999e-25 < z < 4.9999999999999995e164Initial program 75.2%
Taylor expanded in t around 0 81.1%
Taylor expanded in z around inf 81.2%
if -1.8e182 < z < -1.6e11Initial program 85.0%
sub-neg85.0%
distribute-rgt-in85.0%
*-lft-identity85.0%
associate-+r+85.0%
cancel-sign-sub-inv85.0%
div-sub85.0%
associate-*r*85.0%
associate-*l/85.0%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 82.7%
associate--l+82.7%
associate-*r/82.7%
metadata-eval82.7%
associate-*r/82.7%
metadata-eval82.7%
Simplified82.7%
Taylor expanded in z around inf 82.7%
sub-neg82.7%
associate-*r/82.7%
metadata-eval82.7%
metadata-eval82.7%
Simplified82.7%
if -1.6e11 < z < -6.6000000000000004e-108 or 4.9999999999999995e164 < z Initial program 59.8%
sub-neg59.8%
distribute-rgt-in59.8%
*-lft-identity59.8%
associate-+r+59.8%
cancel-sign-sub-inv59.8%
div-sub59.8%
associate-*r*59.8%
associate-*l/59.8%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 79.6%
if -6.6000000000000004e-108 < z < 1.2499999999999999e-25Initial program 97.0%
sub-neg97.0%
distribute-rgt-in97.0%
*-lft-identity97.0%
associate-+r+97.0%
cancel-sign-sub-inv97.0%
div-sub70.1%
associate-*r*70.1%
associate-*l/70.1%
*-inverses97.0%
metadata-eval97.0%
sub-neg97.0%
metadata-eval97.0%
metadata-eval97.0%
+-commutative97.0%
metadata-eval97.0%
associate-/l/97.0%
Simplified97.0%
Taylor expanded in t around 0 71.1%
associate-*r/71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in z around 0 71.1%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -9.5) (/ x y) (if (<= (/ x y) 0.0) (/ 2.0 t) (if (<= (/ x y) 2.0) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9.5) {
tmp = x / y;
} else if ((x / y) <= 0.0) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
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) <= (-9.5d0)) then
tmp = x / y
else if ((x / y) <= 0.0d0) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.0d0) then
tmp = -2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9.5) {
tmp = x / y;
} else if ((x / y) <= 0.0) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -9.5: tmp = x / y elif (x / y) <= 0.0: tmp = 2.0 / t elif (x / y) <= 2.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -9.5) tmp = Float64(x / y); elseif (Float64(x / y) <= 0.0) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.0) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -9.5) tmp = x / y; elseif ((x / y) <= 0.0) tmp = 2.0 / t; elseif ((x / y) <= 2.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -9.5], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.0], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -9.5:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5 or 2 < (/.f64 x y) Initial program 78.6%
sub-neg78.6%
distribute-rgt-in78.6%
*-lft-identity78.6%
associate-+r+78.6%
cancel-sign-sub-inv78.6%
div-sub68.3%
associate-*r*68.3%
associate-*l/68.3%
*-inverses97.7%
metadata-eval97.7%
sub-neg97.7%
metadata-eval97.7%
metadata-eval97.7%
+-commutative97.7%
metadata-eval97.7%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in x around inf 64.2%
if -9.5 < (/.f64 x y) < -0.0Initial program 91.6%
Taylor expanded in z around inf 63.6%
Taylor expanded in t around 0 36.1%
if -0.0 < (/.f64 x y) < 2Initial program 76.2%
sub-neg76.2%
distribute-rgt-in76.2%
*-lft-identity76.2%
associate-+r+76.2%
cancel-sign-sub-inv76.2%
div-sub61.6%
associate-*r*61.6%
associate-*l/61.6%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 47.8%
Final simplification52.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.0)
(+ (/ x y) (* 2.0 (/ (- 1.0 t) t)))
(if (<= z 8e-12)
(+ (/ x y) (+ -2.0 (/ (/ 2.0 z) t)))
(+ (/ x y) (+ -2.0 (/ 2.0 t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.0) {
tmp = (x / y) + (2.0 * ((1.0 - t) / t));
} else if (z <= 8e-12) {
tmp = (x / y) + (-2.0 + ((2.0 / z) / t));
} else {
tmp = (x / y) + (-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 (z <= (-1.0d0)) then
tmp = (x / y) + (2.0d0 * ((1.0d0 - t) / t))
else if (z <= 8d-12) then
tmp = (x / y) + ((-2.0d0) + ((2.0d0 / z) / t))
else
tmp = (x / y) + ((-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 (z <= -1.0) {
tmp = (x / y) + (2.0 * ((1.0 - t) / t));
} else if (z <= 8e-12) {
tmp = (x / y) + (-2.0 + ((2.0 / z) / t));
} else {
tmp = (x / y) + (-2.0 + (2.0 / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.0: tmp = (x / y) + (2.0 * ((1.0 - t) / t)) elif z <= 8e-12: tmp = (x / y) + (-2.0 + ((2.0 / z) / t)) else: tmp = (x / y) + (-2.0 + (2.0 / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / y) + Float64(2.0 * Float64(Float64(1.0 - t) / t))); elseif (z <= 8e-12) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / z) / t))); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.0) tmp = (x / y) + (2.0 * ((1.0 - t) / t)); elseif (z <= 8e-12) tmp = (x / y) + (-2.0 + ((2.0 / z) / t)); else tmp = (x / y) + (-2.0 + (2.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.0], N[(N[(x / y), $MachinePrecision] + N[(2.0 * N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-12], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{y} + 2 \cdot \frac{1 - t}{t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{z}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\end{array}
\end{array}
if z < -1Initial program 72.9%
Taylor expanded in z around inf 99.1%
if -1 < z < 7.99999999999999984e-12Initial program 97.3%
sub-neg97.3%
distribute-rgt-in97.3%
*-lft-identity97.3%
associate-+r+97.3%
cancel-sign-sub-inv97.3%
div-sub74.2%
associate-*r*74.2%
associate-*l/74.2%
*-inverses97.4%
metadata-eval97.4%
sub-neg97.4%
metadata-eval97.4%
metadata-eval97.4%
+-commutative97.4%
metadata-eval97.4%
associate-/l/97.4%
Simplified97.4%
Taylor expanded in z around 0 97.4%
if 7.99999999999999984e-12 < z Initial program 66.1%
sub-neg66.1%
distribute-rgt-in66.1%
*-lft-identity66.1%
associate-+r+66.1%
cancel-sign-sub-inv66.1%
div-sub66.1%
associate-*r*66.1%
associate-*l/66.1%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
associate--l+100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.3e-23)
t_1
(if (<= t 4e-54)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 2.5)
(+ (/ x y) (/ 2.0 t))
(if (<= t 1.85e+34) (/ 2.0 (* z t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.3e-23) {
tmp = t_1;
} else if (t <= 4e-54) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 2.5) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.85e+34) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
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) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-1.3d-23)) then
tmp = t_1
else if (t <= 4d-54) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 2.5d0) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 1.85d+34) then
tmp = 2.0d0 / (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.3e-23) {
tmp = t_1;
} else if (t <= 4e-54) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 2.5) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.85e+34) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -1.3e-23: tmp = t_1 elif t <= 4e-54: tmp = (2.0 + (2.0 / z)) / t elif t <= 2.5: tmp = (x / y) + (2.0 / t) elif t <= 1.85e+34: tmp = 2.0 / (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.3e-23) tmp = t_1; elseif (t <= 4e-54) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 2.5) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 1.85e+34) tmp = Float64(2.0 / Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.3e-23) tmp = t_1; elseif (t <= 4e-54) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 2.5) tmp = (x / y) + (2.0 / t); elseif (t <= 1.85e+34) tmp = 2.0 / (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.3e-23], t$95$1, If[LessEqual[t, 4e-54], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 2.5], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e+34], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-54}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 2.5:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+34}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.3e-23 or 1.85000000000000004e34 < t Initial program 65.2%
sub-neg65.2%
distribute-rgt-in65.2%
*-lft-identity65.2%
associate-+r+65.2%
cancel-sign-sub-inv65.2%
div-sub65.2%
associate-*r*65.2%
associate-*l/65.2%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 82.6%
if -1.3e-23 < t < 4.0000000000000001e-54Initial program 97.1%
sub-neg97.1%
distribute-rgt-in97.1%
*-lft-identity97.1%
associate-+r+97.1%
cancel-sign-sub-inv97.1%
div-sub72.5%
associate-*r*72.5%
associate-*l/72.5%
*-inverses97.1%
metadata-eval97.1%
sub-neg97.1%
metadata-eval97.1%
metadata-eval97.1%
+-commutative97.1%
metadata-eval97.1%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around 0 84.1%
associate-*r/84.1%
metadata-eval84.1%
Simplified84.1%
if 4.0000000000000001e-54 < t < 2.5Initial program 100.0%
Taylor expanded in t around 0 95.6%
Taylor expanded in z around inf 80.8%
if 2.5 < t < 1.85000000000000004e34Initial program 100.0%
sub-neg100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate-+r+100.0%
cancel-sign-sub-inv100.0%
div-sub100.0%
associate-*r*100.0%
associate-*l/100.0%
*-inverses100.0%
metadata-eval100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
metadata-eval100.0%
associate-/l/99.4%
Simplified99.4%
Taylor expanded in z around 0 81.0%
Final simplification83.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3.8) (not (<= (/ x y) 7.5e-7))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3.8) || !((x / y) <= 7.5e-7)) {
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) <= (-3.8d0)) .or. (.not. ((x / y) <= 7.5d-7))) 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) <= -3.8) || !((x / y) <= 7.5e-7)) {
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) <= -3.8) or not ((x / y) <= 7.5e-7): 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) <= -3.8) || !(Float64(x / y) <= 7.5e-7)) 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) <= -3.8) || ~(((x / y) <= 7.5e-7))) 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], -3.8], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7.5e-7]], $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 -3.8 \lor \neg \left(\frac{x}{y} \leq 7.5 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.7999999999999998 or 7.5000000000000002e-7 < (/.f64 x y) Initial program 78.7%
sub-neg78.7%
distribute-rgt-in78.7%
*-lft-identity78.7%
associate-+r+78.7%
cancel-sign-sub-inv78.7%
div-sub67.8%
associate-*r*67.8%
associate-*l/67.8%
*-inverses97.7%
metadata-eval97.7%
sub-neg97.7%
metadata-eval97.7%
metadata-eval97.7%
+-commutative97.7%
metadata-eval97.7%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around inf 64.5%
if -3.7999999999999998 < (/.f64 x y) < 7.5000000000000002e-7Initial program 87.2%
sub-neg87.2%
distribute-rgt-in87.1%
*-lft-identity87.1%
associate-+r+87.1%
cancel-sign-sub-inv87.1%
div-sub76.2%
associate-*r*76.2%
associate-*l/76.2%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 64.1%
sub-neg64.1%
associate-*r/64.1%
metadata-eval64.1%
metadata-eval64.1%
Simplified64.1%
Final simplification64.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7e-108) (not (<= z 1.35e-94))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (/ 2.0 (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e-108) || !(z <= 1.35e-94)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = 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 <= (-7d-108)) .or. (.not. (z <= 1.35d-94))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = 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 <= -7e-108) || !(z <= 1.35e-94)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7e-108) or not (z <= 1.35e-94): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7e-108) || !(z <= 1.35e-94)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(2.0 / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7e-108) || ~((z <= 1.35e-94))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7e-108], N[Not[LessEqual[z, 1.35e-94]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-108} \lor \neg \left(z \leq 1.35 \cdot 10^{-94}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -6.9999999999999997e-108 or 1.3500000000000001e-94 < z Initial program 74.8%
sub-neg74.8%
distribute-rgt-in74.8%
*-lft-identity74.8%
associate-+r+74.8%
cancel-sign-sub-inv74.8%
div-sub74.8%
associate-*r*74.8%
associate-*l/74.8%
*-inverses99.2%
metadata-eval99.2%
sub-neg99.2%
metadata-eval99.2%
metadata-eval99.2%
+-commutative99.2%
metadata-eval99.2%
associate-/l/99.4%
Simplified99.4%
Taylor expanded in z around inf 91.4%
associate--l+91.4%
sub-neg91.4%
associate-*r/91.4%
metadata-eval91.4%
metadata-eval91.4%
Simplified91.4%
if -6.9999999999999997e-108 < z < 1.3500000000000001e-94Initial program 97.6%
sub-neg97.6%
distribute-rgt-in97.6%
*-lft-identity97.6%
associate-+r+97.6%
cancel-sign-sub-inv97.6%
div-sub65.8%
associate-*r*65.8%
associate-*l/65.8%
*-inverses97.6%
metadata-eval97.6%
sub-neg97.6%
metadata-eval97.6%
metadata-eval97.6%
+-commutative97.6%
metadata-eval97.6%
associate-/l/97.6%
Simplified97.6%
Taylor expanded in z around 0 74.9%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5e-43) (not (<= z 3.2e-21))) (+ (/ 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 <= -4.5e-43) || !(z <= 3.2e-21)) {
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 <= (-4.5d-43)) .or. (.not. (z <= 3.2d-21))) 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 <= -4.5e-43) || !(z <= 3.2e-21)) {
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 <= -4.5e-43) or not (z <= 3.2e-21): 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 <= -4.5e-43) || !(z <= 3.2e-21)) 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 <= -4.5e-43) || ~((z <= 3.2e-21))) 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, -4.5e-43], N[Not[LessEqual[z, 3.2e-21]], $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 -4.5 \cdot 10^{-43} \lor \neg \left(z \leq 3.2 \cdot 10^{-21}\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 < -4.50000000000000025e-43 or 3.2000000000000002e-21 < z Initial program 70.5%
sub-neg70.5%
distribute-rgt-in70.5%
*-lft-identity70.5%
associate-+r+70.5%
cancel-sign-sub-inv70.5%
div-sub70.5%
associate-*r*70.5%
associate-*l/70.5%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 98.5%
associate--l+98.5%
sub-neg98.5%
associate-*r/98.5%
metadata-eval98.5%
metadata-eval98.5%
Simplified98.5%
if -4.50000000000000025e-43 < z < 3.2000000000000002e-21Initial program 97.2%
Taylor expanded in t around 0 90.9%
Taylor expanded in z around 0 90.9%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -9.5) (/ x y) (if (<= (/ x y) 6.8e-6) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9.5) {
tmp = x / y;
} else if ((x / y) <= 6.8e-6) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
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) <= (-9.5d0)) then
tmp = x / y
else if ((x / y) <= 6.8d-6) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9.5) {
tmp = x / y;
} else if ((x / y) <= 6.8e-6) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -9.5: tmp = x / y elif (x / y) <= 6.8e-6: tmp = -2.0 + (2.0 / t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -9.5) tmp = Float64(x / y); elseif (Float64(x / y) <= 6.8e-6) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -9.5) tmp = x / y; elseif ((x / y) <= 6.8e-6) tmp = -2.0 + (2.0 / t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -9.5], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.8e-6], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -9.5:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5 or 6.80000000000000012e-6 < (/.f64 x y) Initial program 78.7%
sub-neg78.7%
distribute-rgt-in78.7%
*-lft-identity78.7%
associate-+r+78.7%
cancel-sign-sub-inv78.7%
div-sub67.8%
associate-*r*67.8%
associate-*l/67.8%
*-inverses97.7%
metadata-eval97.7%
sub-neg97.7%
metadata-eval97.7%
metadata-eval97.7%
+-commutative97.7%
metadata-eval97.7%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in x around inf 63.8%
if -9.5 < (/.f64 x y) < 6.80000000000000012e-6Initial program 87.2%
sub-neg87.2%
distribute-rgt-in87.1%
*-lft-identity87.1%
associate-+r+87.1%
cancel-sign-sub-inv87.1%
div-sub76.2%
associate-*r*76.2%
associate-*l/76.2%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 64.1%
sub-neg64.1%
associate-*r/64.1%
metadata-eval64.1%
metadata-eval64.1%
Simplified64.1%
Final simplification63.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.2e-43)
(+ (/ x y) (* 2.0 (/ (- 1.0 t) t)))
(if (<= z 1.6e-15)
(+ (/ x y) (/ 2.0 (* z t)))
(+ (/ x y) (+ -2.0 (/ 2.0 t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-43) {
tmp = (x / y) + (2.0 * ((1.0 - t) / t));
} else if (z <= 1.6e-15) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = (x / y) + (-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 (z <= (-5.2d-43)) then
tmp = (x / y) + (2.0d0 * ((1.0d0 - t) / t))
else if (z <= 1.6d-15) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = (x / y) + ((-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 (z <= -5.2e-43) {
tmp = (x / y) + (2.0 * ((1.0 - t) / t));
} else if (z <= 1.6e-15) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = (x / y) + (-2.0 + (2.0 / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e-43: tmp = (x / y) + (2.0 * ((1.0 - t) / t)) elif z <= 1.6e-15: tmp = (x / y) + (2.0 / (z * t)) else: tmp = (x / y) + (-2.0 + (2.0 / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e-43) tmp = Float64(Float64(x / y) + Float64(2.0 * Float64(Float64(1.0 - t) / t))); elseif (z <= 1.6e-15) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e-43) tmp = (x / y) + (2.0 * ((1.0 - t) / t)); elseif (z <= 1.6e-15) tmp = (x / y) + (2.0 / (z * t)); else tmp = (x / y) + (-2.0 + (2.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e-43], N[(N[(x / y), $MachinePrecision] + N[(2.0 * N[(N[(1.0 - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-15], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{y} + 2 \cdot \frac{1 - t}{t}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\end{array}
\end{array}
if z < -5.2e-43Initial program 74.8%
Taylor expanded in z around inf 97.2%
if -5.2e-43 < z < 1.6e-15Initial program 97.2%
Taylor expanded in t around 0 90.9%
Taylor expanded in z around 0 90.9%
if 1.6e-15 < z Initial program 66.1%
sub-neg66.1%
distribute-rgt-in66.1%
*-lft-identity66.1%
associate-+r+66.1%
cancel-sign-sub-inv66.1%
div-sub66.1%
associate-*r*66.1%
associate-*l/66.1%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
associate--l+100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification95.1%
(FPCore (x y z t) :precision binary64 (+ (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (/ x y)))
double code(double x, double y, double z, double t) {
return (-2.0 + ((2.0 + (2.0 / z)) / t)) + (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) + ((2.0d0 + (2.0d0 / z)) / t)) + (x / y)
end function
public static double code(double x, double y, double z, double t) {
return (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y);
}
def code(x, y, z, t): return (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y)
function code(x, y, z, t) return Float64(Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) + Float64(x / y)) end
function tmp = code(x, y, z, t) tmp = (-2.0 + ((2.0 + (2.0 / z)) / t)) + (x / y); end
code[x_, y_, z_, t_] := N[(N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-2 + \frac{2 + \frac{2}{z}}{t}\right) + \frac{x}{y}
\end{array}
Initial program 82.6%
sub-neg82.6%
distribute-rgt-in82.6%
*-lft-identity82.6%
associate-+r+82.6%
cancel-sign-sub-inv82.6%
div-sub71.7%
associate-*r*71.7%
associate-*l/71.7%
*-inverses98.7%
metadata-eval98.7%
sub-neg98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
metadata-eval98.7%
associate-/l/98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (<= t -7e-18) -2.0 (if (<= t 126000.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7e-18) {
tmp = -2.0;
} else if (t <= 126000.0) {
tmp = 2.0 / t;
} 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 (t <= (-7d-18)) then
tmp = -2.0d0
else if (t <= 126000.0d0) then
tmp = 2.0d0 / t
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 (t <= -7e-18) {
tmp = -2.0;
} else if (t <= 126000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7e-18: tmp = -2.0 elif t <= 126000.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7e-18) tmp = -2.0; elseif (t <= 126000.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -7e-18) tmp = -2.0; elseif (t <= 126000.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7e-18], -2.0, If[LessEqual[t, 126000.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-18}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 126000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -6.9999999999999997e-18 or 126000 < t Initial program 66.0%
sub-neg66.0%
distribute-rgt-in66.0%
*-lft-identity66.0%
associate-+r+66.0%
cancel-sign-sub-inv66.0%
div-sub66.1%
associate-*r*66.1%
associate-*l/66.1%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 53.3%
associate--l+53.3%
associate-*r/53.3%
metadata-eval53.3%
associate-*r/53.3%
metadata-eval53.3%
Simplified53.3%
Taylor expanded in t around inf 33.6%
if -6.9999999999999997e-18 < t < 126000Initial program 97.5%
Taylor expanded in z around inf 60.0%
Taylor expanded in t around 0 37.9%
Final simplification35.8%
(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 82.6%
sub-neg82.6%
distribute-rgt-in82.6%
*-lft-identity82.6%
associate-+r+82.6%
cancel-sign-sub-inv82.6%
div-sub71.7%
associate-*r*71.7%
associate-*l/71.7%
*-inverses98.7%
metadata-eval98.7%
sub-neg98.7%
metadata-eval98.7%
metadata-eval98.7%
+-commutative98.7%
metadata-eval98.7%
associate-/l/98.7%
Simplified98.7%
Taylor expanded in x around 0 67.4%
associate--l+67.4%
associate-*r/67.4%
metadata-eval67.4%
associate-*r/67.4%
metadata-eval67.4%
Simplified67.4%
Taylor expanded in t around inf 17.2%
Final simplification17.2%
(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 2023178
(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))))