
(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.4%
sub-neg85.4%
distribute-rgt-in85.4%
*-lft-identity85.4%
associate-+r+85.4%
cancel-sign-sub-inv85.4%
div-sub76.8%
associate-*r*76.8%
associate-*l/76.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%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (/ 2.0 (* z t))))
(if (<= (/ x y) -3.9e+64)
(/ x y)
(if (<= (/ x y) -1.55e-15)
t_2
(if (<= (/ x y) -2.05e-85)
t_1
(if (<= (/ x y) -1.3e-119)
t_2
(if (<= (/ x y) 1.5e-102)
t_1
(if (<= (/ x y) 3.8e-12) t_2 (- (/ x y) 2.0)))))))))
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 tmp;
if ((x / y) <= -3.9e+64) {
tmp = x / y;
} else if ((x / y) <= -1.55e-15) {
tmp = t_2;
} else if ((x / y) <= -2.05e-85) {
tmp = t_1;
} else if ((x / y) <= -1.3e-119) {
tmp = t_2;
} else if ((x / y) <= 1.5e-102) {
tmp = t_1;
} else if ((x / y) <= 3.8e-12) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = 2.0d0 / (z * t)
if ((x / y) <= (-3.9d+64)) then
tmp = x / y
else if ((x / y) <= (-1.55d-15)) then
tmp = t_2
else if ((x / y) <= (-2.05d-85)) then
tmp = t_1
else if ((x / y) <= (-1.3d-119)) then
tmp = t_2
else if ((x / y) <= 1.5d-102) then
tmp = t_1
else if ((x / y) <= 3.8d-12) then
tmp = t_2
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 t_1 = -2.0 + (2.0 / t);
double t_2 = 2.0 / (z * t);
double tmp;
if ((x / y) <= -3.9e+64) {
tmp = x / y;
} else if ((x / y) <= -1.55e-15) {
tmp = t_2;
} else if ((x / y) <= -2.05e-85) {
tmp = t_1;
} else if ((x / y) <= -1.3e-119) {
tmp = t_2;
} else if ((x / y) <= 1.5e-102) {
tmp = t_1;
} else if ((x / y) <= 3.8e-12) {
tmp = t_2;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = 2.0 / (z * t) tmp = 0 if (x / y) <= -3.9e+64: tmp = x / y elif (x / y) <= -1.55e-15: tmp = t_2 elif (x / y) <= -2.05e-85: tmp = t_1 elif (x / y) <= -1.3e-119: tmp = t_2 elif (x / y) <= 1.5e-102: tmp = t_1 elif (x / y) <= 3.8e-12: tmp = t_2 else: tmp = (x / y) - 2.0 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)) tmp = 0.0 if (Float64(x / y) <= -3.9e+64) tmp = Float64(x / y); elseif (Float64(x / y) <= -1.55e-15) tmp = t_2; elseif (Float64(x / y) <= -2.05e-85) tmp = t_1; elseif (Float64(x / y) <= -1.3e-119) tmp = t_2; elseif (Float64(x / y) <= 1.5e-102) tmp = t_1; elseif (Float64(x / y) <= 3.8e-12) tmp = t_2; else tmp = Float64(Float64(x / y) - 2.0); 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); tmp = 0.0; if ((x / y) <= -3.9e+64) tmp = x / y; elseif ((x / y) <= -1.55e-15) tmp = t_2; elseif ((x / y) <= -2.05e-85) tmp = t_1; elseif ((x / y) <= -1.3e-119) tmp = t_2; elseif ((x / y) <= 1.5e-102) tmp = t_1; elseif ((x / y) <= 3.8e-12) tmp = t_2; else tmp = (x / y) - 2.0; 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]}, If[LessEqual[N[(x / y), $MachinePrecision], -3.9e+64], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.55e-15], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -2.05e-85], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -1.3e-119], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 1.5e-102], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 3.8e-12], t$95$2, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -3.9 \cdot 10^{+64}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.55 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq -2.05 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq -1.3 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq 1.5 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.8999999999999998e64Initial program 83.0%
sub-neg83.0%
distribute-rgt-in83.0%
*-lft-identity83.0%
associate-+r+83.0%
cancel-sign-sub-inv83.0%
div-sub79.2%
associate-*r*79.2%
associate-*l/79.2%
*-inverses100.0%
metadata-eval100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
metadata-eval100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around inf 89.2%
if -3.8999999999999998e64 < (/.f64 x y) < -1.5499999999999999e-15 or -2.04999999999999997e-85 < (/.f64 x y) < -1.30000000000000006e-119 or 1.5e-102 < (/.f64 x y) < 3.79999999999999996e-12Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
*-commutative99.7%
times-frac99.5%
fma-def99.5%
*-commutative99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in t around 0 82.6%
Taylor expanded in z around 0 69.5%
Taylor expanded in t around 0 69.5%
if -1.5499999999999999e-15 < (/.f64 x y) < -2.04999999999999997e-85 or -1.30000000000000006e-119 < (/.f64 x y) < 1.5e-102Initial program 75.5%
sub-neg75.5%
distribute-rgt-in75.5%
*-lft-identity75.5%
associate-+r+75.5%
cancel-sign-sub-inv75.5%
div-sub63.9%
associate-*r*63.9%
associate-*l/63.9%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in z around inf 71.3%
sub-neg71.3%
associate-*r/71.3%
metadata-eval71.3%
metadata-eval71.3%
+-commutative71.3%
Simplified71.3%
if 3.79999999999999996e-12 < (/.f64 x y) Initial program 92.4%
sub-neg92.4%
distribute-rgt-in92.4%
*-lft-identity92.4%
associate-+r+92.4%
cancel-sign-sub-inv92.4%
div-sub88.0%
associate-*r*88.0%
associate-*l/88.0%
*-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 t around inf 73.4%
Final simplification75.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))) (t_2 (/ 2.0 (* z t))))
(if (<= (/ x y) -5.5e+64)
(/ x y)
(if (<= (/ x y) -1.5e-15)
(/ (/ -2.0 t) (- z))
(if (<= (/ x y) -6.4e-71)
t_1
(if (<= (/ x y) -1.3e-119)
t_2
(if (<= (/ x y) 2.2e-102)
t_1
(if (<= (/ x y) 2e-11) t_2 (- (/ x y) 2.0)))))))))
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 tmp;
if ((x / y) <= -5.5e+64) {
tmp = x / y;
} else if ((x / y) <= -1.5e-15) {
tmp = (-2.0 / t) / -z;
} else if ((x / y) <= -6.4e-71) {
tmp = t_1;
} else if ((x / y) <= -1.3e-119) {
tmp = t_2;
} else if ((x / y) <= 2.2e-102) {
tmp = t_1;
} else if ((x / y) <= 2e-11) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / t)
t_2 = 2.0d0 / (z * t)
if ((x / y) <= (-5.5d+64)) then
tmp = x / y
else if ((x / y) <= (-1.5d-15)) then
tmp = ((-2.0d0) / t) / -z
else if ((x / y) <= (-6.4d-71)) then
tmp = t_1
else if ((x / y) <= (-1.3d-119)) then
tmp = t_2
else if ((x / y) <= 2.2d-102) then
tmp = t_1
else if ((x / y) <= 2d-11) then
tmp = t_2
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 t_1 = -2.0 + (2.0 / t);
double t_2 = 2.0 / (z * t);
double tmp;
if ((x / y) <= -5.5e+64) {
tmp = x / y;
} else if ((x / y) <= -1.5e-15) {
tmp = (-2.0 / t) / -z;
} else if ((x / y) <= -6.4e-71) {
tmp = t_1;
} else if ((x / y) <= -1.3e-119) {
tmp = t_2;
} else if ((x / y) <= 2.2e-102) {
tmp = t_1;
} else if ((x / y) <= 2e-11) {
tmp = t_2;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) t_2 = 2.0 / (z * t) tmp = 0 if (x / y) <= -5.5e+64: tmp = x / y elif (x / y) <= -1.5e-15: tmp = (-2.0 / t) / -z elif (x / y) <= -6.4e-71: tmp = t_1 elif (x / y) <= -1.3e-119: tmp = t_2 elif (x / y) <= 2.2e-102: tmp = t_1 elif (x / y) <= 2e-11: tmp = t_2 else: tmp = (x / y) - 2.0 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)) tmp = 0.0 if (Float64(x / y) <= -5.5e+64) tmp = Float64(x / y); elseif (Float64(x / y) <= -1.5e-15) tmp = Float64(Float64(-2.0 / t) / Float64(-z)); elseif (Float64(x / y) <= -6.4e-71) tmp = t_1; elseif (Float64(x / y) <= -1.3e-119) tmp = t_2; elseif (Float64(x / y) <= 2.2e-102) tmp = t_1; elseif (Float64(x / y) <= 2e-11) tmp = t_2; else tmp = Float64(Float64(x / y) - 2.0); 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); tmp = 0.0; if ((x / y) <= -5.5e+64) tmp = x / y; elseif ((x / y) <= -1.5e-15) tmp = (-2.0 / t) / -z; elseif ((x / y) <= -6.4e-71) tmp = t_1; elseif ((x / y) <= -1.3e-119) tmp = t_2; elseif ((x / y) <= 2.2e-102) tmp = t_1; elseif ((x / y) <= 2e-11) tmp = t_2; else tmp = (x / y) - 2.0; 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]}, If[LessEqual[N[(x / y), $MachinePrecision], -5.5e+64], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.5e-15], N[(N[(-2.0 / t), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -6.4e-71], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -1.3e-119], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 2.2e-102], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2e-11], t$95$2, N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
t_2 := \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -5.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{-2}{t}}{-z}\\
\mathbf{elif}\;\frac{x}{y} \leq -6.4 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq -1.3 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.2 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -5.4999999999999996e64Initial program 83.0%
sub-neg83.0%
distribute-rgt-in83.0%
*-lft-identity83.0%
associate-+r+83.0%
cancel-sign-sub-inv83.0%
div-sub79.2%
associate-*r*79.2%
associate-*l/79.2%
*-inverses100.0%
metadata-eval100.0%
sub-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
+-commutative100.0%
metadata-eval100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around inf 89.2%
if -5.4999999999999996e64 < (/.f64 x y) < -1.5e-15Initial program 99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.4%
distribute-rgt1-in99.4%
*-commutative99.4%
times-frac99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in t around 0 80.1%
Taylor expanded in z around 0 57.3%
un-div-inv57.3%
frac-2neg57.3%
metadata-eval57.3%
distribute-rgt-neg-in57.3%
Applied egg-rr57.3%
associate-/r*57.5%
Simplified57.5%
if -1.5e-15 < (/.f64 x y) < -6.3999999999999998e-71 or -1.30000000000000006e-119 < (/.f64 x y) < 2.20000000000000013e-102Initial program 75.5%
sub-neg75.5%
distribute-rgt-in75.5%
*-lft-identity75.5%
associate-+r+75.5%
cancel-sign-sub-inv75.5%
div-sub63.9%
associate-*r*63.9%
associate-*l/63.9%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in z around inf 71.3%
sub-neg71.3%
associate-*r/71.3%
metadata-eval71.3%
metadata-eval71.3%
+-commutative71.3%
Simplified71.3%
if -6.3999999999999998e-71 < (/.f64 x y) < -1.30000000000000006e-119 or 2.20000000000000013e-102 < (/.f64 x y) < 1.99999999999999988e-11Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
times-frac99.4%
fma-def99.4%
*-commutative99.4%
fma-def99.4%
Simplified99.4%
Taylor expanded in t around 0 84.0%
Taylor expanded in z around 0 76.5%
Taylor expanded in t around 0 76.5%
if 1.99999999999999988e-11 < (/.f64 x y) Initial program 92.4%
sub-neg92.4%
distribute-rgt-in92.4%
*-lft-identity92.4%
associate-+r+92.4%
cancel-sign-sub-inv92.4%
div-sub88.0%
associate-*r*88.0%
associate-*l/88.0%
*-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 t around inf 73.4%
Final simplification75.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ (/ 2.0 t) z))) (t_2 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -2.4e+55)
t_2
(if (<= (/ x y) -3.7e-227)
t_1
(if (<= (/ x y) 0.0)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 5.7e+20) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + ((2.0 / t) / z);
double t_2 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2.4e+55) {
tmp = t_2;
} else if ((x / y) <= -3.7e-227) {
tmp = t_1;
} else if ((x / y) <= 0.0) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 5.7e+20) {
tmp = t_1;
} 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) / z)
t_2 = (x / y) + (2.0d0 / t)
if ((x / y) <= (-2.4d+55)) then
tmp = t_2
else if ((x / y) <= (-3.7d-227)) then
tmp = t_1
else if ((x / y) <= 0.0d0) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 5.7d+20) then
tmp = t_1
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) / z);
double t_2 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2.4e+55) {
tmp = t_2;
} else if ((x / y) <= -3.7e-227) {
tmp = t_1;
} else if ((x / y) <= 0.0) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 5.7e+20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + ((2.0 / t) / z) t_2 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -2.4e+55: tmp = t_2 elif (x / y) <= -3.7e-227: tmp = t_1 elif (x / y) <= 0.0: tmp = -2.0 + (2.0 / t) elif (x / y) <= 5.7e+20: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(Float64(2.0 / t) / z)) t_2 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -2.4e+55) tmp = t_2; elseif (Float64(x / y) <= -3.7e-227) tmp = t_1; elseif (Float64(x / y) <= 0.0) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 5.7e+20) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + ((2.0 / t) / z); t_2 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -2.4e+55) tmp = t_2; elseif ((x / y) <= -3.7e-227) tmp = t_1; elseif ((x / y) <= 0.0) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 5.7e+20) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2.4e+55], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -3.7e-227], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 0.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.7e+20], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{\frac{2}{t}}{z}\\
t_2 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -2.4 \cdot 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{x}{y} \leq -3.7 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq 0:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5.7 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 x y) < -2.3999999999999999e55 or 5.7e20 < (/.f64 x y) Initial program 89.8%
sub-neg89.8%
distribute-rgt-in89.8%
*-lft-identity89.8%
associate-+r+89.8%
cancel-sign-sub-inv89.8%
div-sub84.7%
associate-*r*84.7%
associate-*l/84.7%
*-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 85.9%
associate--l+85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in t around 0 85.9%
if -2.3999999999999999e55 < (/.f64 x y) < -3.69999999999999978e-227 or 0.0 < (/.f64 x y) < 5.7e20Initial program 81.4%
sub-neg81.4%
distribute-rgt-in81.4%
*-lft-identity81.4%
associate-+r+81.4%
cancel-sign-sub-inv81.4%
div-sub71.1%
associate-*r*71.1%
associate-*l/71.1%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.7%
Simplified99.8%
Taylor expanded in x around 0 95.7%
associate-*r/95.7%
metadata-eval95.7%
+-commutative95.7%
associate--l+95.7%
associate-*r/95.7%
metadata-eval95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in t around inf 79.0%
if -3.69999999999999978e-227 < (/.f64 x y) < 0.0Initial program 82.2%
sub-neg82.2%
distribute-rgt-in82.2%
*-lft-identity82.2%
associate-+r+82.2%
cancel-sign-sub-inv82.2%
div-sub67.1%
associate-*r*67.1%
associate-*l/67.1%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in z around inf 71.7%
sub-neg71.7%
associate-*r/71.7%
metadata-eval71.7%
metadata-eval71.7%
+-commutative71.7%
Simplified71.7%
Final simplification81.1%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -100000000000.0)
(/ x y)
(if (<= (/ x y) -1.65e-273)
-2.0
(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) <= -100000000000.0) {
tmp = x / y;
} else if ((x / y) <= -1.65e-273) {
tmp = -2.0;
} 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) <= (-100000000000.0d0)) then
tmp = x / y
else if ((x / y) <= (-1.65d-273)) then
tmp = -2.0d0
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) <= -100000000000.0) {
tmp = x / y;
} else if ((x / y) <= -1.65e-273) {
tmp = -2.0;
} 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) <= -100000000000.0: tmp = x / y elif (x / y) <= -1.65e-273: tmp = -2.0 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) <= -100000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -1.65e-273) tmp = -2.0; 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) <= -100000000000.0) tmp = x / y; elseif ((x / y) <= -1.65e-273) tmp = -2.0; 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], -100000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.65e-273], -2.0, 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 -100000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.65 \cdot 10^{-273}:\\
\;\;\;\;-2\\
\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) < -1e11 or 2 < (/.f64 x y) Initial program 89.7%
sub-neg89.7%
distribute-rgt-in89.7%
*-lft-identity89.7%
associate-+r+89.7%
cancel-sign-sub-inv89.7%
div-sub84.9%
associate-*r*84.9%
associate-*l/84.9%
*-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 x around inf 75.5%
if -1e11 < (/.f64 x y) < -1.64999999999999995e-273 or 0.0 < (/.f64 x y) < 2Initial program 78.9%
sub-neg78.9%
distribute-rgt-in78.9%
*-lft-identity78.9%
associate-+r+78.9%
cancel-sign-sub-inv78.9%
div-sub67.9%
associate-*r*67.9%
associate-*l/67.9%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in x around 0 98.5%
associate-*r/98.5%
metadata-eval98.5%
+-commutative98.5%
associate--l+98.5%
associate-*r/98.5%
metadata-eval98.5%
associate-/r*98.5%
Simplified98.5%
Taylor expanded in t around inf 40.9%
if -1.64999999999999995e-273 < (/.f64 x y) < 0.0Initial program 86.5%
sub-neg86.5%
distribute-rgt-in86.5%
*-lft-identity86.5%
associate-+r+86.5%
cancel-sign-sub-inv86.5%
div-sub70.7%
associate-*r*70.7%
associate-*l/70.7%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in z around inf 70.2%
associate--l+70.2%
associate-*r/70.2%
metadata-eval70.2%
Simplified70.2%
Taylor expanded in t around 0 42.6%
Taylor expanded in x around 0 42.6%
Final simplification58.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+20) (not (<= (/ x y) 5e-10))) (+ (/ x y) (/ 2.0 (* z t))) (+ (/ (/ 2.0 t) z) (- (/ 2.0 t) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+20) || !((x / y) <= 5e-10)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 / t) / z) + ((2.0 / t) - 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) <= (-1d+20)) .or. (.not. ((x / y) <= 5d-10))) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = ((2.0d0 / t) / z) + ((2.0d0 / t) - 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) <= -1e+20) || !((x / y) <= 5e-10)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 / t) / z) + ((2.0 / t) - 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+20) or not ((x / y) <= 5e-10): tmp = (x / y) + (2.0 / (z * t)) else: tmp = ((2.0 / t) / z) + ((2.0 / t) - 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+20) || !(Float64(x / y) <= 5e-10)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(Float64(Float64(2.0 / t) / z) + Float64(Float64(2.0 / t) - 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+20) || ~(((x / y) <= 5e-10))) tmp = (x / y) + (2.0 / (z * t)); else tmp = ((2.0 / t) / z) + ((2.0 / t) - 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+20], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e-10]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+20} \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z} + \left(\frac{2}{t} - 2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1e20 or 5.00000000000000031e-10 < (/.f64 x y) Initial program 89.6%
Taylor expanded in z around 0 92.7%
if -1e20 < (/.f64 x y) < 5.00000000000000031e-10Initial program 81.3%
sub-neg81.3%
distribute-rgt-in81.3%
*-lft-identity81.3%
associate-+r+81.3%
cancel-sign-sub-inv81.3%
div-sub68.9%
associate-*r*68.9%
associate-*l/68.9%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in x around 0 98.9%
associate-*r/98.9%
metadata-eval98.9%
+-commutative98.9%
associate--l+98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/r*99.0%
Simplified99.0%
Final simplification95.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (- (/ 2.0 t) 2.0))))
(if (<= t -9e-97)
t_1
(if (<= t 5.2e-148)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 1.25e-34)
(+ (/ x y) (/ 2.0 t))
(if (<= t 1.5e-17) (/ 2.0 (* z t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + ((2.0 / t) - 2.0);
double tmp;
if (t <= -9e-97) {
tmp = t_1;
} else if (t <= 5.2e-148) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 1.25e-34) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.5e-17) {
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 / t) - 2.0d0)
if (t <= (-9d-97)) then
tmp = t_1
else if (t <= 5.2d-148) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 1.25d-34) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 1.5d-17) 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 / t) - 2.0);
double tmp;
if (t <= -9e-97) {
tmp = t_1;
} else if (t <= 5.2e-148) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 1.25e-34) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.5e-17) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + ((2.0 / t) - 2.0) tmp = 0 if t <= -9e-97: tmp = t_1 elif t <= 5.2e-148: tmp = (2.0 + (2.0 / z)) / t elif t <= 1.25e-34: tmp = (x / y) + (2.0 / t) elif t <= 1.5e-17: tmp = 2.0 / (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)) tmp = 0.0 if (t <= -9e-97) tmp = t_1; elseif (t <= 5.2e-148) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 1.25e-34) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 1.5e-17) 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 / t) - 2.0); tmp = 0.0; if (t <= -9e-97) tmp = t_1; elseif (t <= 5.2e-148) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 1.25e-34) tmp = (x / y) + (2.0 / t); elseif (t <= 1.5e-17) 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] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9e-97], t$95$1, If[LessEqual[t, 5.2e-148], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.25e-34], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-17], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{if}\;t \leq -9 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-148}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-34}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.0000000000000002e-97 or 1.50000000000000003e-17 < t Initial program 75.4%
sub-neg75.4%
distribute-rgt-in75.4%
*-lft-identity75.4%
associate-+r+75.4%
cancel-sign-sub-inv75.4%
div-sub75.4%
associate-*r*75.4%
associate-*l/75.4%
*-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 z around inf 85.7%
associate--l+85.7%
associate-*r/85.7%
metadata-eval85.7%
Simplified85.7%
if -9.0000000000000002e-97 < t < 5.20000000000000015e-148Initial program 99.6%
sub-neg99.6%
distribute-rgt-in99.6%
*-lft-identity99.6%
associate-+r+99.6%
cancel-sign-sub-inv99.6%
div-sub74.0%
associate-*r*74.0%
associate-*l/74.0%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 86.3%
associate-*r/86.3%
metadata-eval86.3%
+-commutative86.3%
associate--l+86.3%
associate-*r/86.3%
metadata-eval86.3%
associate-/r*86.4%
Simplified86.4%
Taylor expanded in t around 0 86.4%
associate-*r/86.4%
metadata-eval86.4%
Simplified86.4%
if 5.20000000000000015e-148 < t < 1.2500000000000001e-34Initial program 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
*-lft-identity99.9%
associate-+r+99.9%
cancel-sign-sub-inv99.9%
div-sub90.3%
associate-*r*90.3%
associate-*l/90.3%
*-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 z around inf 76.8%
associate--l+76.8%
associate-*r/76.8%
metadata-eval76.8%
Simplified76.8%
Taylor expanded in t around 0 76.8%
if 1.2500000000000001e-34 < t < 1.50000000000000003e-17Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
*-commutative99.7%
times-frac99.0%
fma-def99.0%
*-commutative99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in t around 0 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in t around 0 99.7%
Final simplification85.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -6.6e+14)
t_2
(if (<= t -2e-108)
t_1
(if (<= t 9.5e-235)
(/ (/ -2.0 t) (- z))
(if (<= t 1.2e-34) t_1 (if (<= t 4.8e-16) (/ 2.0 (* z t)) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -6.6e+14) {
tmp = t_2;
} else if (t <= -2e-108) {
tmp = t_1;
} else if (t <= 9.5e-235) {
tmp = (-2.0 / t) / -z;
} else if (t <= 1.2e-34) {
tmp = t_1;
} else if (t <= 4.8e-16) {
tmp = 2.0 / (z * t);
} 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 = (x / y) + (2.0d0 / t)
t_2 = (x / y) - 2.0d0
if (t <= (-6.6d+14)) then
tmp = t_2
else if (t <= (-2d-108)) then
tmp = t_1
else if (t <= 9.5d-235) then
tmp = ((-2.0d0) / t) / -z
else if (t <= 1.2d-34) then
tmp = t_1
else if (t <= 4.8d-16) then
tmp = 2.0d0 / (z * t)
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 = (x / y) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -6.6e+14) {
tmp = t_2;
} else if (t <= -2e-108) {
tmp = t_1;
} else if (t <= 9.5e-235) {
tmp = (-2.0 / t) / -z;
} else if (t <= 1.2e-34) {
tmp = t_1;
} else if (t <= 4.8e-16) {
tmp = 2.0 / (z * t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -6.6e+14: tmp = t_2 elif t <= -2e-108: tmp = t_1 elif t <= 9.5e-235: tmp = (-2.0 / t) / -z elif t <= 1.2e-34: tmp = t_1 elif t <= 4.8e-16: tmp = 2.0 / (z * t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -6.6e+14) tmp = t_2; elseif (t <= -2e-108) tmp = t_1; elseif (t <= 9.5e-235) tmp = Float64(Float64(-2.0 / t) / Float64(-z)); elseif (t <= 1.2e-34) tmp = t_1; elseif (t <= 4.8e-16) tmp = Float64(2.0 / Float64(z * t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -6.6e+14) tmp = t_2; elseif (t <= -2e-108) tmp = t_1; elseif (t <= 9.5e-235) tmp = (-2.0 / t) / -z; elseif (t <= 1.2e-34) tmp = t_1; elseif (t <= 4.8e-16) tmp = 2.0 / (z * t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -6.6e+14], t$95$2, If[LessEqual[t, -2e-108], t$95$1, If[LessEqual[t, 9.5e-235], N[(N[(-2.0 / t), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[t, 1.2e-34], t$95$1, If[LessEqual[t, 4.8e-16], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{+14}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-235}:\\
\;\;\;\;\frac{\frac{-2}{t}}{-z}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-16}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.6e14 or 4.8000000000000001e-16 < t Initial program 71.2%
sub-neg71.2%
distribute-rgt-in71.2%
*-lft-identity71.2%
associate-+r+71.2%
cancel-sign-sub-inv71.2%
div-sub71.2%
associate-*r*71.2%
associate-*l/71.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 85.4%
if -6.6e14 < t < -2.00000000000000008e-108 or 9.4999999999999996e-235 < t < 1.19999999999999996e-34Initial program 99.8%
sub-neg99.8%
distribute-rgt-in99.8%
*-lft-identity99.8%
associate-+r+99.8%
cancel-sign-sub-inv99.8%
div-sub92.5%
associate-*r*92.5%
associate-*l/92.5%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in z around inf 71.8%
associate--l+71.8%
associate-*r/71.8%
metadata-eval71.8%
Simplified71.8%
Taylor expanded in t around 0 71.8%
if -2.00000000000000008e-108 < t < 9.4999999999999996e-235Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
associate-*r*99.6%
distribute-rgt1-in99.6%
*-commutative99.6%
times-frac99.8%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in t around 0 87.0%
Taylor expanded in z around 0 56.4%
un-div-inv56.4%
frac-2neg56.4%
metadata-eval56.4%
distribute-rgt-neg-in56.4%
Applied egg-rr56.4%
associate-/r*56.5%
Simplified56.5%
if 1.19999999999999996e-34 < t < 4.8000000000000001e-16Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
*-commutative99.7%
times-frac99.0%
fma-def99.0%
*-commutative99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in t around 0 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in t around 0 99.7%
Final simplification76.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -3.4e-58)
t_1
(if (<= t 1.4e-148)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= t 1e-34)
(+ (/ x y) (/ 2.0 t))
(if (<= t 9.5e-14) (/ 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 <= -3.4e-58) {
tmp = t_1;
} else if (t <= 1.4e-148) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 1e-34) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 9.5e-14) {
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 <= (-3.4d-58)) then
tmp = t_1
else if (t <= 1.4d-148) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if (t <= 1d-34) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 9.5d-14) 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 <= -3.4e-58) {
tmp = t_1;
} else if (t <= 1.4e-148) {
tmp = (2.0 + (2.0 / z)) / t;
} else if (t <= 1e-34) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 9.5e-14) {
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 <= -3.4e-58: tmp = t_1 elif t <= 1.4e-148: tmp = (2.0 + (2.0 / z)) / t elif t <= 1e-34: tmp = (x / y) + (2.0 / t) elif t <= 9.5e-14: 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 <= -3.4e-58) tmp = t_1; elseif (t <= 1.4e-148) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (t <= 1e-34) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 9.5e-14) 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 <= -3.4e-58) tmp = t_1; elseif (t <= 1.4e-148) tmp = (2.0 + (2.0 / z)) / t; elseif (t <= 1e-34) tmp = (x / y) + (2.0 / t); elseif (t <= 9.5e-14) 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, -3.4e-58], t$95$1, If[LessEqual[t, 1.4e-148], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1e-34], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-14], 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 -3.4 \cdot 10^{-58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-148}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 10^{-34}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.39999999999999973e-58 or 9.4999999999999999e-14 < t Initial program 74.4%
sub-neg74.4%
distribute-rgt-in74.4%
*-lft-identity74.4%
associate-+r+74.4%
cancel-sign-sub-inv74.4%
div-sub74.4%
associate-*r*74.4%
associate-*l/74.4%
*-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 83.2%
if -3.39999999999999973e-58 < t < 1.4e-148Initial program 99.6%
sub-neg99.6%
distribute-rgt-in99.6%
*-lft-identity99.6%
associate-+r+99.6%
cancel-sign-sub-inv99.6%
div-sub75.8%
associate-*r*75.8%
associate-*l/75.8%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 84.6%
associate-*r/84.6%
metadata-eval84.6%
+-commutative84.6%
associate--l+84.6%
associate-*r/84.6%
metadata-eval84.6%
associate-/r*84.7%
Simplified84.7%
Taylor expanded in t around 0 84.8%
associate-*r/84.8%
metadata-eval84.8%
Simplified84.8%
if 1.4e-148 < t < 9.99999999999999928e-35Initial program 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
*-lft-identity99.9%
associate-+r+99.9%
cancel-sign-sub-inv99.9%
div-sub90.3%
associate-*r*90.3%
associate-*l/90.3%
*-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 z around inf 76.8%
associate--l+76.8%
associate-*r/76.8%
metadata-eval76.8%
Simplified76.8%
Taylor expanded in t around 0 76.8%
if 9.99999999999999928e-35 < t < 9.4999999999999999e-14Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
*-commutative99.7%
times-frac99.0%
fma-def99.0%
*-commutative99.0%
fma-def99.0%
Simplified99.0%
Taylor expanded in t around 0 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in t around 0 99.7%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.2e+19) (not (<= z 1.15e-10))) (+ (/ x y) (- (/ 2.0 t) 2.0)) (+ (/ x y) (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e+19) || !(z <= 1.15e-10)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} 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.2d+19)) .or. (.not. (z <= 1.15d-10))) then
tmp = (x / y) + ((2.0d0 / t) - 2.0d0)
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.2e+19) || !(z <= 1.15e-10)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.2e+19) or not (z <= 1.15e-10): tmp = (x / y) + ((2.0 / t) - 2.0) else: tmp = (x / y) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.2e+19) || !(z <= 1.15e-10)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); 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.2e+19) || ~((z <= 1.15e-10))) tmp = (x / y) + ((2.0 / t) - 2.0); else tmp = (x / y) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.2e+19], N[Not[LessEqual[z, 1.15e-10]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $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.2 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -4.2e19 or 1.15000000000000004e-10 < z Initial program 69.8%
sub-neg69.8%
distribute-rgt-in69.8%
*-lft-identity69.8%
associate-+r+69.8%
cancel-sign-sub-inv69.8%
div-sub69.8%
associate-*r*69.8%
associate-*l/69.8%
*-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 97.8%
associate--l+97.8%
associate-*r/97.8%
metadata-eval97.8%
Simplified97.8%
if -4.2e19 < z < 1.15000000000000004e-10Initial program 99.8%
Taylor expanded in z around 0 88.8%
Final simplification93.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.75e+14) (/ x y) (if (<= (/ x y) 245.0) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.75e+14) {
tmp = x / y;
} else if ((x / y) <= 245.0) {
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) <= (-1.75d+14)) then
tmp = x / y
else if ((x / y) <= 245.0d0) 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) <= -1.75e+14) {
tmp = x / y;
} else if ((x / y) <= 245.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.75e+14: tmp = x / y elif (x / y) <= 245.0: 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) <= -1.75e+14) tmp = Float64(x / y); elseif (Float64(x / y) <= 245.0) 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) <= -1.75e+14) tmp = x / y; elseif ((x / y) <= 245.0) 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], -1.75e+14], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 245.0], 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 -1.75 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 245:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.75e14 or 245 < (/.f64 x y) Initial program 89.7%
sub-neg89.7%
distribute-rgt-in89.7%
*-lft-identity89.7%
associate-+r+89.7%
cancel-sign-sub-inv89.7%
div-sub84.9%
associate-*r*84.9%
associate-*l/84.9%
*-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 x around inf 75.5%
if -1.75e14 < (/.f64 x y) < 245Initial program 81.1%
sub-neg81.1%
distribute-rgt-in81.1%
*-lft-identity81.1%
associate-+r+81.1%
cancel-sign-sub-inv81.1%
div-sub68.7%
associate-*r*68.7%
associate-*l/68.7%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in x around 0 98.9%
associate-*r/98.9%
metadata-eval98.9%
+-commutative98.9%
associate--l+98.9%
associate-*r/98.9%
metadata-eval98.9%
associate-/r*99.0%
Simplified99.0%
Taylor expanded in z around inf 60.3%
sub-neg60.3%
associate-*r/60.3%
metadata-eval60.3%
metadata-eval60.3%
+-commutative60.3%
Simplified60.3%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -3600000000000.0) (/ x y) (if (<= (/ x y) 9e-43) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -3600000000000.0) {
tmp = x / y;
} else if ((x / y) <= 9e-43) {
tmp = -2.0 + (2.0 / 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) <= (-3600000000000.0d0)) then
tmp = x / y
else if ((x / y) <= 9d-43) then
tmp = (-2.0d0) + (2.0d0 / 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) <= -3600000000000.0) {
tmp = x / y;
} else if ((x / y) <= 9e-43) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -3600000000000.0: tmp = x / y elif (x / y) <= 9e-43: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -3600000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 9e-43) tmp = Float64(-2.0 + Float64(2.0 / 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) <= -3600000000000.0) tmp = x / y; elseif ((x / y) <= 9e-43) tmp = -2.0 + (2.0 / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -3600000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 9e-43], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3600000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 9 \cdot 10^{-43}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.6e12Initial program 85.4%
sub-neg85.4%
distribute-rgt-in85.4%
*-lft-identity85.4%
associate-+r+85.4%
cancel-sign-sub-inv85.4%
div-sub80.5%
associate-*r*80.5%
associate-*l/80.5%
*-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 inf 79.8%
if -3.6e12 < (/.f64 x y) < 9.0000000000000005e-43Initial program 80.4%
sub-neg80.4%
distribute-rgt-in80.4%
*-lft-identity80.4%
associate-+r+80.4%
cancel-sign-sub-inv80.4%
div-sub67.8%
associate-*r*67.8%
associate-*l/67.8%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in x around 0 99.4%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-/r*99.4%
Simplified99.4%
Taylor expanded in z around inf 61.6%
sub-neg61.6%
associate-*r/61.6%
metadata-eval61.6%
metadata-eval61.6%
+-commutative61.6%
Simplified61.6%
if 9.0000000000000005e-43 < (/.f64 x y) Initial program 93.2%
sub-neg93.2%
distribute-rgt-in93.2%
*-lft-identity93.2%
associate-+r+93.2%
cancel-sign-sub-inv93.2%
div-sub87.9%
associate-*r*87.9%
associate-*l/87.9%
*-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 69.8%
Final simplification68.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1.4e-11) -2.0 (if (<= t 7.2e+18) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-11) {
tmp = -2.0;
} else if (t <= 7.2e+18) {
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 <= (-1.4d-11)) then
tmp = -2.0d0
else if (t <= 7.2d+18) 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 <= -1.4e-11) {
tmp = -2.0;
} else if (t <= 7.2e+18) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.4e-11: tmp = -2.0 elif t <= 7.2e+18: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.4e-11) tmp = -2.0; elseif (t <= 7.2e+18) 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 <= -1.4e-11) tmp = -2.0; elseif (t <= 7.2e+18) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.4e-11], -2.0, If[LessEqual[t, 7.2e+18], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-11}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.4e-11 or 7.2e18 < t Initial program 71.0%
sub-neg71.0%
distribute-rgt-in71.0%
*-lft-identity71.0%
associate-+r+71.0%
cancel-sign-sub-inv71.0%
div-sub71.0%
associate-*r*71.0%
associate-*l/71.0%
*-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 50.5%
associate-*r/50.5%
metadata-eval50.5%
+-commutative50.5%
associate--l+50.5%
associate-*r/50.5%
metadata-eval50.5%
associate-/r*50.6%
Simplified50.6%
Taylor expanded in t around inf 37.6%
if -1.4e-11 < t < 7.2e18Initial program 99.7%
sub-neg99.7%
distribute-rgt-in99.7%
*-lft-identity99.7%
associate-+r+99.7%
cancel-sign-sub-inv99.7%
div-sub82.5%
associate-*r*82.5%
associate-*l/82.5%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in z around inf 56.5%
associate--l+56.5%
associate-*r/56.5%
metadata-eval56.5%
Simplified56.5%
Taylor expanded in t around 0 55.9%
Taylor expanded in x around 0 31.1%
Final simplification34.4%
(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.4%
sub-neg85.4%
distribute-rgt-in85.4%
*-lft-identity85.4%
associate-+r+85.4%
cancel-sign-sub-inv85.4%
div-sub76.8%
associate-*r*76.8%
associate-*l/76.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 x around 0 63.0%
associate-*r/63.0%
metadata-eval63.0%
+-commutative63.0%
associate--l+63.0%
associate-*r/63.0%
metadata-eval63.0%
associate-/r*63.0%
Simplified63.0%
Taylor expanded in t around inf 20.0%
Final simplification20.0%
(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 2023242
(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))))