
(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 15 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 (- (+ 1.0 (/ 1.0 z)) t) (/ 2.0 t) (/ x y)))
double code(double x, double y, double z, double t) {
return fma(((1.0 + (1.0 / z)) - t), (2.0 / t), (x / y));
}
function code(x, y, z, t) return fma(Float64(Float64(1.0 + Float64(1.0 / z)) - t), Float64(2.0 / t), Float64(x / y)) end
code[x_, y_, z_, t_] := N[(N[(N[(1.0 + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] * N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(1 + \frac{1}{z}\right) - t, \frac{2}{t}, \frac{x}{y}\right)
\end{array}
Initial program 90.1%
+-commutative90.1%
*-commutative90.1%
associate-*r*90.1%
distribute-rgt1-in90.1%
*-commutative90.1%
times-frac90.2%
fma-def91.0%
*-commutative91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.3e+39)
(/ x y)
(if (<= (/ x y) -7.8e-81)
(/ 2.0 t)
(if (<= (/ x y) 5.5e-74)
-2.0
(if (<= (/ x y) 2.3e+24) (/ 2.0 t) (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.3e+39) {
tmp = x / y;
} else if ((x / y) <= -7.8e-81) {
tmp = 2.0 / t;
} else if ((x / y) <= 5.5e-74) {
tmp = -2.0;
} else if ((x / y) <= 2.3e+24) {
tmp = 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) <= (-2.3d+39)) then
tmp = x / y
else if ((x / y) <= (-7.8d-81)) then
tmp = 2.0d0 / t
else if ((x / y) <= 5.5d-74) then
tmp = -2.0d0
else if ((x / y) <= 2.3d+24) then
tmp = 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) <= -2.3e+39) {
tmp = x / y;
} else if ((x / y) <= -7.8e-81) {
tmp = 2.0 / t;
} else if ((x / y) <= 5.5e-74) {
tmp = -2.0;
} else if ((x / y) <= 2.3e+24) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.3e+39: tmp = x / y elif (x / y) <= -7.8e-81: tmp = 2.0 / t elif (x / y) <= 5.5e-74: tmp = -2.0 elif (x / y) <= 2.3e+24: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.3e+39) tmp = Float64(x / y); elseif (Float64(x / y) <= -7.8e-81) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 5.5e-74) tmp = -2.0; elseif (Float64(x / y) <= 2.3e+24) tmp = 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) <= -2.3e+39) tmp = x / y; elseif ((x / y) <= -7.8e-81) tmp = 2.0 / t; elseif ((x / y) <= 5.5e-74) tmp = -2.0; elseif ((x / y) <= 2.3e+24) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.3e+39], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -7.8e-81], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.5e-74], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2.3e+24], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -7.8 \cdot 10^{-81}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 5.5 \cdot 10^{-74}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.3 \cdot 10^{+24}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.30000000000000012e39 or 2.2999999999999999e24 < (/.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-sub78.5%
associate-*r*78.5%
associate-*l/78.5%
*-inverses97.9%
metadata-eval97.9%
sub-neg97.9%
metadata-eval97.9%
metadata-eval97.9%
+-commutative97.9%
metadata-eval97.9%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in x around inf 66.7%
if -2.30000000000000012e39 < (/.f64 x y) < -7.7999999999999997e-81 or 5.5000000000000001e-74 < (/.f64 x y) < 2.2999999999999999e24Initial program 90.1%
sub-neg90.1%
distribute-rgt-in90.1%
*-lft-identity90.1%
associate-+r+90.1%
cancel-sign-sub-inv90.1%
div-sub76.7%
associate-*r*76.7%
associate-*l/76.7%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around 0 84.2%
associate-*r/84.2%
metadata-eval84.2%
Simplified84.2%
Taylor expanded in z around inf 36.7%
if -7.7999999999999997e-81 < (/.f64 x y) < 5.5000000000000001e-74Initial program 90.4%
+-commutative90.4%
*-commutative90.4%
associate-*r*90.4%
distribute-rgt1-in90.4%
*-commutative90.4%
times-frac90.5%
fma-def90.5%
*-commutative90.5%
fma-def90.5%
Simplified90.5%
Taylor expanded in z around 0 99.7%
fma-udef99.7%
associate--l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.8%
associate-+r-99.8%
associate-*r/99.8%
associate-*l/99.7%
associate-+r-99.7%
Simplified99.7%
Taylor expanded in t around inf 39.2%
Final simplification49.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4e+41) (not (<= (/ x y) 4e+24))) (+ (/ x y) (/ 2.0 (* z t))) (* (- (+ 1.0 (/ 1.0 z)) t) (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4e+41) || !((x / y) <= 4e+24)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((1.0 + (1.0 / z)) - t) * (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) <= (-4d+41)) .or. (.not. ((x / y) <= 4d+24))) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = ((1.0d0 + (1.0d0 / z)) - t) * (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) <= -4e+41) || !((x / y) <= 4e+24)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((1.0 + (1.0 / z)) - t) * (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4e+41) or not ((x / y) <= 4e+24): tmp = (x / y) + (2.0 / (z * t)) else: tmp = ((1.0 + (1.0 / z)) - t) * (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -4e+41) || !(Float64(x / y) <= 4e+24)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / z)) - t) * Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -4e+41) || ~(((x / y) <= 4e+24))) tmp = (x / y) + (2.0 / (z * t)); else tmp = ((1.0 + (1.0 / z)) - t) * (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4e+41], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+24]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] * N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+41} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \frac{1}{z}\right) - t\right) \cdot \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.00000000000000002e41 or 3.9999999999999999e24 < (/.f64 x y) Initial program 89.7%
clear-num89.5%
associate-/r*81.3%
frac-add73.6%
*-un-lft-identity73.6%
+-commutative73.6%
associate-*l*73.6%
fma-def73.6%
Applied egg-rr73.6%
Taylor expanded in z around 0 79.8%
Taylor expanded in z around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
associate-/r*89.1%
+-commutative89.1%
associate-/r*89.1%
Simplified89.1%
if -4.00000000000000002e41 < (/.f64 x y) < 3.9999999999999999e24Initial program 90.3%
+-commutative90.3%
*-commutative90.3%
associate-*r*90.3%
distribute-rgt1-in90.3%
*-commutative90.3%
times-frac90.4%
fma-def90.4%
*-commutative90.4%
fma-def90.4%
Simplified90.4%
Taylor expanded in z around 0 99.7%
fma-udef99.7%
associate--l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 97.5%
associate-+r-97.5%
associate-*r/97.5%
associate-*l/97.5%
associate-+r-97.5%
Simplified97.5%
Final simplification94.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))))
(if (or (<= (/ x y) -4e+41) (not (<= (/ x y) 4e+24)))
(+ (/ x y) t_1)
(+ t_1 (- (/ 2.0 t) 2.0)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double tmp;
if (((x / y) <= -4e+41) || !((x / y) <= 4e+24)) {
tmp = (x / y) + t_1;
} else {
tmp = t_1 + ((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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 / (z * t)
if (((x / y) <= (-4d+41)) .or. (.not. ((x / y) <= 4d+24))) then
tmp = (x / y) + t_1
else
tmp = t_1 + ((2.0d0 / t) - 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 / (z * t);
double tmp;
if (((x / y) <= -4e+41) || !((x / y) <= 4e+24)) {
tmp = (x / y) + t_1;
} else {
tmp = t_1 + ((2.0 / t) - 2.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) tmp = 0 if ((x / y) <= -4e+41) or not ((x / y) <= 4e+24): tmp = (x / y) + t_1 else: tmp = t_1 + ((2.0 / t) - 2.0) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) tmp = 0.0 if ((Float64(x / y) <= -4e+41) || !(Float64(x / y) <= 4e+24)) tmp = Float64(Float64(x / y) + t_1); else tmp = Float64(t_1 + Float64(Float64(2.0 / t) - 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); tmp = 0.0; if (((x / y) <= -4e+41) || ~(((x / y) <= 4e+24))) tmp = (x / y) + t_1; else tmp = t_1 + ((2.0 / t) - 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x / y), $MachinePrecision], -4e+41], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4e+24]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -4 \cdot 10^{+41} \lor \neg \left(\frac{x}{y} \leq 4 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{y} + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{2}{t} - 2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -4.00000000000000002e41 or 3.9999999999999999e24 < (/.f64 x y) Initial program 89.7%
clear-num89.5%
associate-/r*81.3%
frac-add73.6%
*-un-lft-identity73.6%
+-commutative73.6%
associate-*l*73.6%
fma-def73.6%
Applied egg-rr73.6%
Taylor expanded in z around 0 79.8%
Taylor expanded in z around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
associate-/r*89.1%
+-commutative89.1%
associate-/r*89.1%
Simplified89.1%
if -4.00000000000000002e41 < (/.f64 x y) < 3.9999999999999999e24Initial program 90.3%
sub-neg90.3%
distribute-rgt-in90.3%
*-lft-identity90.3%
associate-+r+90.3%
cancel-sign-sub-inv90.3%
div-sub78.9%
associate-*r*78.9%
associate-*l/78.9%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in x around 0 97.6%
associate-*r/97.6%
metadata-eval97.6%
+-commutative97.6%
associate--l+97.6%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
Final simplification94.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ (/ 2.0 t) -2.0)))
(if (<= z -2.1e+179)
t_2
(if (<= z -3.4e+83)
t_1
(if (<= z -8.6e-5)
t_2
(if (<= z 1.02e-19)
(/ 2.0 (* z t))
(if (<= z 1.08e+154) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = (2.0 / t) + -2.0;
double tmp;
if (z <= -2.1e+179) {
tmp = t_2;
} else if (z <= -3.4e+83) {
tmp = t_1;
} else if (z <= -8.6e-5) {
tmp = t_2;
} else if (z <= 1.02e-19) {
tmp = 2.0 / (z * t);
} else if (z <= 1.08e+154) {
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 = (x / y) - 2.0d0
t_2 = (2.0d0 / t) + (-2.0d0)
if (z <= (-2.1d+179)) then
tmp = t_2
else if (z <= (-3.4d+83)) then
tmp = t_1
else if (z <= (-8.6d-5)) then
tmp = t_2
else if (z <= 1.02d-19) then
tmp = 2.0d0 / (z * t)
else if (z <= 1.08d+154) 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 = (x / y) - 2.0;
double t_2 = (2.0 / t) + -2.0;
double tmp;
if (z <= -2.1e+179) {
tmp = t_2;
} else if (z <= -3.4e+83) {
tmp = t_1;
} else if (z <= -8.6e-5) {
tmp = t_2;
} else if (z <= 1.02e-19) {
tmp = 2.0 / (z * t);
} else if (z <= 1.08e+154) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = (2.0 / t) + -2.0 tmp = 0 if z <= -2.1e+179: tmp = t_2 elif z <= -3.4e+83: tmp = t_1 elif z <= -8.6e-5: tmp = t_2 elif z <= 1.02e-19: tmp = 2.0 / (z * t) elif z <= 1.08e+154: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(Float64(2.0 / t) + -2.0) tmp = 0.0 if (z <= -2.1e+179) tmp = t_2; elseif (z <= -3.4e+83) tmp = t_1; elseif (z <= -8.6e-5) tmp = t_2; elseif (z <= 1.02e-19) tmp = Float64(2.0 / Float64(z * t)); elseif (z <= 1.08e+154) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = (2.0 / t) + -2.0; tmp = 0.0; if (z <= -2.1e+179) tmp = t_2; elseif (z <= -3.4e+83) tmp = t_1; elseif (z <= -8.6e-5) tmp = t_2; elseif (z <= 1.02e-19) tmp = 2.0 / (z * t); elseif (z <= 1.08e+154) tmp = t_1; else tmp = t_2; 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[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]}, If[LessEqual[z, -2.1e+179], t$95$2, If[LessEqual[z, -3.4e+83], t$95$1, If[LessEqual[z, -8.6e-5], t$95$2, If[LessEqual[z, 1.02e-19], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e+154], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := \frac{2}{t} + -2\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+179}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-19}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.0999999999999999e179 or -3.3999999999999998e83 < z < -8.6000000000000003e-5 or 1.08e154 < z Initial program 76.5%
+-commutative76.5%
*-commutative76.5%
associate-*r*76.5%
distribute-rgt1-in76.5%
*-commutative76.5%
times-frac77.1%
fma-def77.0%
*-commutative77.0%
fma-def77.0%
Simplified77.0%
Taylor expanded in z around 0 99.9%
fma-udef99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 76.4%
associate-+r-76.4%
associate-*r/76.4%
associate-*l/76.3%
associate-+r-76.3%
Simplified76.3%
Taylor expanded in z around inf 75.4%
div-sub75.4%
sub-neg75.4%
*-inverses75.4%
metadata-eval75.4%
distribute-lft-in75.4%
associate-*r/75.4%
metadata-eval75.4%
metadata-eval75.4%
Simplified75.4%
if -2.0999999999999999e179 < z < -3.3999999999999998e83 or 1.02000000000000004e-19 < z < 1.08e154Initial program 87.4%
sub-neg87.4%
distribute-rgt-in87.4%
*-lft-identity87.4%
associate-+r+87.4%
cancel-sign-sub-inv87.4%
div-sub87.4%
associate-*r*87.4%
associate-*l/87.4%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified100.0%
Taylor expanded in t around inf 75.6%
if -8.6000000000000003e-5 < z < 1.02000000000000004e-19Initial program 98.3%
sub-neg98.3%
distribute-rgt-in98.3%
*-lft-identity98.3%
associate-+r+98.3%
cancel-sign-sub-inv98.3%
div-sub76.9%
associate-*r*76.9%
associate-*l/76.9%
*-inverses98.4%
metadata-eval98.4%
sub-neg98.4%
metadata-eval98.4%
metadata-eval98.4%
+-commutative98.4%
metadata-eval98.4%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in z around 0 69.3%
Final simplification72.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.6e+174)
(+ (/ 2.0 t) -2.0)
(if (<= z -1.55e+82)
(- (/ x y) 2.0)
(if (or (<= z -0.00032) (not (<= z 7e-19)))
(+ (/ 2.0 t) (/ x y))
(/ 2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.6e+174) {
tmp = (2.0 / t) + -2.0;
} else if (z <= -1.55e+82) {
tmp = (x / y) - 2.0;
} else if ((z <= -0.00032) || !(z <= 7e-19)) {
tmp = (2.0 / t) + (x / y);
} 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 <= (-7.6d+174)) then
tmp = (2.0d0 / t) + (-2.0d0)
else if (z <= (-1.55d+82)) then
tmp = (x / y) - 2.0d0
else if ((z <= (-0.00032d0)) .or. (.not. (z <= 7d-19))) then
tmp = (2.0d0 / t) + (x / y)
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 <= -7.6e+174) {
tmp = (2.0 / t) + -2.0;
} else if (z <= -1.55e+82) {
tmp = (x / y) - 2.0;
} else if ((z <= -0.00032) || !(z <= 7e-19)) {
tmp = (2.0 / t) + (x / y);
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.6e+174: tmp = (2.0 / t) + -2.0 elif z <= -1.55e+82: tmp = (x / y) - 2.0 elif (z <= -0.00032) or not (z <= 7e-19): tmp = (2.0 / t) + (x / y) else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.6e+174) tmp = Float64(Float64(2.0 / t) + -2.0); elseif (z <= -1.55e+82) tmp = Float64(Float64(x / y) - 2.0); elseif ((z <= -0.00032) || !(z <= 7e-19)) tmp = Float64(Float64(2.0 / t) + Float64(x / y)); 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 <= -7.6e+174) tmp = (2.0 / t) + -2.0; elseif (z <= -1.55e+82) tmp = (x / y) - 2.0; elseif ((z <= -0.00032) || ~((z <= 7e-19))) tmp = (2.0 / t) + (x / y); else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.6e+174], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], If[LessEqual[z, -1.55e+82], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[Or[LessEqual[z, -0.00032], N[Not[LessEqual[z, 7e-19]], $MachinePrecision]], N[(N[(2.0 / t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+174}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;z \leq -0.00032 \lor \neg \left(z \leq 7 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{2}{t} + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -7.6000000000000004e174Initial program 68.6%
+-commutative68.6%
*-commutative68.6%
associate-*r*68.6%
distribute-rgt1-in68.6%
*-commutative68.6%
times-frac69.6%
fma-def69.5%
*-commutative69.5%
fma-def69.5%
Simplified69.5%
Taylor expanded in z around 0 99.8%
fma-udef99.9%
associate--l+99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 77.6%
associate-+r-77.6%
associate-*r/77.6%
associate-*l/77.5%
associate-+r-77.5%
Simplified77.5%
Taylor expanded in z around inf 77.6%
div-sub77.6%
sub-neg77.6%
*-inverses77.6%
metadata-eval77.6%
distribute-lft-in77.6%
associate-*r/77.6%
metadata-eval77.6%
metadata-eval77.6%
Simplified77.6%
if -7.6000000000000004e174 < z < -1.55000000000000016e82Initial program 80.0%
sub-neg80.0%
distribute-rgt-in80.0%
*-lft-identity80.0%
associate-+r+80.0%
cancel-sign-sub-inv80.0%
div-sub80.0%
associate-*r*80.0%
associate-*l/80.0%
*-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 t around inf 87.0%
if -1.55000000000000016e82 < z < -3.20000000000000026e-4 or 7.00000000000000031e-19 < z Initial program 85.6%
Taylor expanded in t around 0 80.8%
Taylor expanded in z around inf 78.9%
if -3.20000000000000026e-4 < z < 7.00000000000000031e-19Initial program 98.3%
sub-neg98.3%
distribute-rgt-in98.3%
*-lft-identity98.3%
associate-+r+98.3%
cancel-sign-sub-inv98.3%
div-sub76.9%
associate-*r*76.9%
associate-*l/76.9%
*-inverses98.4%
metadata-eval98.4%
sub-neg98.4%
metadata-eval98.4%
metadata-eval98.4%
+-commutative98.4%
metadata-eval98.4%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in z around 0 69.3%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3900.0) (not (<= t 2.3e+15))) (- (/ x y) 2.0) (* (+ 1.0 (/ 1.0 z)) (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3900.0) || !(t <= 2.3e+15)) {
tmp = (x / y) - 2.0;
} else {
tmp = (1.0 + (1.0 / z)) * (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 ((t <= (-3900.0d0)) .or. (.not. (t <= 2.3d+15))) then
tmp = (x / y) - 2.0d0
else
tmp = (1.0d0 + (1.0d0 / z)) * (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3900.0) || !(t <= 2.3e+15)) {
tmp = (x / y) - 2.0;
} else {
tmp = (1.0 + (1.0 / z)) * (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3900.0) or not (t <= 2.3e+15): tmp = (x / y) - 2.0 else: tmp = (1.0 + (1.0 / z)) * (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3900.0) || !(t <= 2.3e+15)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(1.0 + Float64(1.0 / z)) * Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3900.0) || ~((t <= 2.3e+15))) tmp = (x / y) - 2.0; else tmp = (1.0 + (1.0 / z)) * (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3900.0], N[Not[LessEqual[t, 2.3e+15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(1.0 + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] * N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3900 \lor \neg \left(t \leq 2.3 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{1}{z}\right) \cdot \frac{2}{t}\\
\end{array}
\end{array}
if t < -3900 or 2.3e15 < t Initial program 80.4%
sub-neg80.4%
distribute-rgt-in80.4%
*-lft-identity80.4%
associate-+r+80.4%
cancel-sign-sub-inv80.4%
div-sub80.4%
associate-*r*80.4%
associate-*l/80.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 78.6%
if -3900 < t < 2.3e15Initial program 98.3%
+-commutative98.3%
*-commutative98.3%
associate-*r*98.3%
distribute-rgt1-in98.3%
*-commutative98.3%
times-frac98.4%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
fma-udef98.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 86.2%
associate-+r-86.2%
associate-*r/86.2%
associate-*l/86.3%
associate-+r-86.3%
Simplified86.3%
Taylor expanded in t around 0 86.3%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.8) (not (<= t 2.6e+14))) (+ (/ x y) (- (/ 2.0 t) 2.0)) (* (+ 1.0 (/ 1.0 z)) (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8) || !(t <= 2.6e+14)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (1.0 + (1.0 / z)) * (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 ((t <= (-4.8d0)) .or. (.not. (t <= 2.6d+14))) then
tmp = (x / y) + ((2.0d0 / t) - 2.0d0)
else
tmp = (1.0d0 + (1.0d0 / z)) * (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8) || !(t <= 2.6e+14)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (1.0 + (1.0 / z)) * (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.8) or not (t <= 2.6e+14): tmp = (x / y) + ((2.0 / t) - 2.0) else: tmp = (1.0 + (1.0 / z)) * (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.8) || !(t <= 2.6e+14)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); else tmp = Float64(Float64(1.0 + Float64(1.0 / z)) * Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.8) || ~((t <= 2.6e+14))) tmp = (x / y) + ((2.0 / t) - 2.0); else tmp = (1.0 + (1.0 / z)) * (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.8], N[Not[LessEqual[t, 2.6e+14]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(1.0 / z), $MachinePrecision]), $MachinePrecision] * N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \lor \neg \left(t \leq 2.6 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{1}{z}\right) \cdot \frac{2}{t}\\
\end{array}
\end{array}
if t < -4.79999999999999982 or 2.6e14 < t Initial program 80.4%
sub-neg80.4%
distribute-rgt-in80.4%
*-lft-identity80.4%
associate-+r+80.4%
cancel-sign-sub-inv80.4%
div-sub80.4%
associate-*r*80.4%
associate-*l/80.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 78.8%
associate--l+78.8%
associate-*r/78.8%
metadata-eval78.8%
Simplified78.8%
if -4.79999999999999982 < t < 2.6e14Initial program 98.3%
+-commutative98.3%
*-commutative98.3%
associate-*r*98.3%
distribute-rgt1-in98.3%
*-commutative98.3%
times-frac98.4%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
fma-udef98.4%
associate--l+98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 86.2%
associate-+r-86.2%
associate-*r/86.2%
associate-*l/86.3%
associate-+r-86.3%
Simplified86.3%
Taylor expanded in t around 0 86.3%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.6e-5) (not (<= z 5.6e-8))) (+ (/ 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 <= -7.6e-5) || !(z <= 5.6e-8)) {
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 <= (-7.6d-5)) .or. (.not. (z <= 5.6d-8))) 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 <= -7.6e-5) || !(z <= 5.6e-8)) {
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 <= -7.6e-5) or not (z <= 5.6e-8): 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 <= -7.6e-5) || !(z <= 5.6e-8)) 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 <= -7.6e-5) || ~((z <= 5.6e-8))) 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, -7.6e-5], N[Not[LessEqual[z, 5.6e-8]], $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 -7.6 \cdot 10^{-5} \lor \neg \left(z \leq 5.6 \cdot 10^{-8}\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 < -7.6000000000000004e-5 or 5.5999999999999999e-8 < z Initial program 80.5%
sub-neg80.5%
distribute-rgt-in80.5%
*-lft-identity80.5%
associate-+r+80.5%
cancel-sign-sub-inv80.5%
div-sub80.5%
associate-*r*80.5%
associate-*l/80.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 99.4%
associate--l+99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
if -7.6000000000000004e-5 < z < 5.5999999999999999e-8Initial program 98.4%
clear-num98.3%
associate-/r*98.2%
frac-add75.5%
*-un-lft-identity75.5%
+-commutative75.5%
associate-*l*75.5%
fma-def75.5%
Applied egg-rr75.5%
Taylor expanded in z around 0 63.4%
Taylor expanded in z around 0 85.8%
associate-*r/85.8%
metadata-eval85.8%
associate-/r*85.8%
+-commutative85.8%
associate-/r*85.8%
Simplified85.8%
Final simplification92.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5.2e+39) (/ x y) (if (<= (/ x y) 4.4e+24) (+ (/ 2.0 t) -2.0) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5.2e+39) {
tmp = x / y;
} else if ((x / y) <= 4.4e+24) {
tmp = (2.0 / t) + -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) <= (-5.2d+39)) then
tmp = x / y
else if ((x / y) <= 4.4d+24) then
tmp = (2.0d0 / t) + (-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) <= -5.2e+39) {
tmp = x / y;
} else if ((x / y) <= 4.4e+24) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5.2e+39: tmp = x / y elif (x / y) <= 4.4e+24: tmp = (2.0 / t) + -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5.2e+39) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.4e+24) tmp = Float64(Float64(2.0 / t) + -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) <= -5.2e+39) tmp = x / y; elseif ((x / y) <= 4.4e+24) tmp = (2.0 / t) + -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5.2e+39], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.4e+24], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5.2 \cdot 10^{+39}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.4 \cdot 10^{+24}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.2e39 or 4.40000000000000003e24 < (/.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-sub78.5%
associate-*r*78.5%
associate-*l/78.5%
*-inverses97.9%
metadata-eval97.9%
sub-neg97.9%
metadata-eval97.9%
metadata-eval97.9%
+-commutative97.9%
metadata-eval97.9%
associate-/l/97.9%
Simplified97.9%
Taylor expanded in x around inf 66.7%
if -5.2e39 < (/.f64 x y) < 4.40000000000000003e24Initial program 90.3%
+-commutative90.3%
*-commutative90.3%
associate-*r*90.3%
distribute-rgt1-in90.3%
*-commutative90.3%
times-frac90.4%
fma-def90.4%
*-commutative90.4%
fma-def90.4%
Simplified90.4%
Taylor expanded in z around 0 99.7%
fma-udef99.7%
associate--l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 97.5%
associate-+r-97.5%
associate-*r/97.5%
associate-*l/97.5%
associate-+r-97.5%
Simplified97.5%
Taylor expanded in z around inf 54.9%
div-sub54.9%
sub-neg54.9%
*-inverses54.9%
metadata-eval54.9%
distribute-lft-in54.9%
associate-*r/54.9%
metadata-eval54.9%
metadata-eval54.9%
Simplified54.9%
Final simplification59.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.45e+40) (/ x y) (if (<= (/ x y) 6.8e-21) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.45e+40) {
tmp = x / y;
} else if ((x / y) <= 6.8e-21) {
tmp = (2.0 / t) + -2.0;
} 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) <= (-1.45d+40)) then
tmp = x / y
else if ((x / y) <= 6.8d-21) then
tmp = (2.0d0 / t) + (-2.0d0)
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) <= -1.45e+40) {
tmp = x / y;
} else if ((x / y) <= 6.8e-21) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.45e+40: tmp = x / y elif (x / y) <= 6.8e-21: tmp = (2.0 / t) + -2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.45e+40) tmp = Float64(x / y); elseif (Float64(x / y) <= 6.8e-21) tmp = Float64(Float64(2.0 / t) + -2.0); 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) <= -1.45e+40) tmp = x / y; elseif ((x / y) <= 6.8e-21) tmp = (2.0 / t) + -2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.45e+40], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.8e-21], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.45 \cdot 10^{+40}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.8 \cdot 10^{-21}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.45000000000000009e40Initial program 92.7%
sub-neg92.7%
distribute-rgt-in92.7%
*-lft-identity92.7%
associate-+r+92.7%
cancel-sign-sub-inv92.7%
div-sub83.2%
associate-*r*83.2%
associate-*l/83.2%
*-inverses97.5%
metadata-eval97.5%
sub-neg97.5%
metadata-eval97.5%
metadata-eval97.5%
+-commutative97.5%
metadata-eval97.5%
associate-/l/97.5%
Simplified97.5%
Taylor expanded in x around inf 68.0%
if -1.45000000000000009e40 < (/.f64 x y) < 6.8e-21Initial program 91.5%
+-commutative91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt1-in91.5%
*-commutative91.5%
times-frac91.7%
fma-def91.7%
*-commutative91.7%
fma-def91.7%
Simplified91.7%
Taylor expanded in z around 0 99.7%
fma-udef99.7%
associate--l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
associate-+r-99.7%
associate-*r/99.7%
associate-*l/99.7%
associate-+r-99.7%
Simplified99.7%
Taylor expanded in z around inf 56.5%
div-sub56.5%
sub-neg56.5%
*-inverses56.5%
metadata-eval56.5%
distribute-lft-in56.5%
associate-*r/56.5%
metadata-eval56.5%
metadata-eval56.5%
Simplified56.5%
if 6.8e-21 < (/.f64 x y) Initial program 85.4%
sub-neg85.4%
distribute-rgt-in85.4%
*-lft-identity85.4%
associate-+r+85.4%
cancel-sign-sub-inv85.4%
div-sub75.2%
associate-*r*75.2%
associate-*l/75.2%
*-inverses98.4%
metadata-eval98.4%
sub-neg98.4%
metadata-eval98.4%
metadata-eval98.4%
+-commutative98.4%
metadata-eval98.4%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 61.1%
Final simplification59.6%
(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 90.1%
sub-neg90.1%
distribute-rgt-in90.1%
*-lft-identity90.1%
associate-+r+90.1%
cancel-sign-sub-inv90.1%
div-sub78.7%
associate-*r*78.7%
associate-*l/78.7%
*-inverses99.0%
metadata-eval99.0%
sub-neg99.0%
metadata-eval99.0%
metadata-eval99.0%
+-commutative99.0%
metadata-eval99.0%
associate-/l/99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -19.0) (not (<= t 4e+15))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -19.0) || !(t <= 4e+15)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-19.0d0)) .or. (.not. (t <= 4d+15))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 + (2.0d0 / z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -19.0) || !(t <= 4e+15)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -19.0) or not (t <= 4e+15): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -19.0) || !(t <= 4e+15)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -19.0) || ~((t <= 4e+15))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -19.0], N[Not[LessEqual[t, 4e+15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -19 \lor \neg \left(t \leq 4 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -19 or 4e15 < t Initial program 80.4%
sub-neg80.4%
distribute-rgt-in80.4%
*-lft-identity80.4%
associate-+r+80.4%
cancel-sign-sub-inv80.4%
div-sub80.4%
associate-*r*80.4%
associate-*l/80.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 78.6%
if -19 < t < 4e15Initial program 98.3%
sub-neg98.3%
distribute-rgt-in98.3%
*-lft-identity98.3%
associate-+r+98.3%
cancel-sign-sub-inv98.3%
div-sub77.3%
associate-*r*77.3%
associate-*l/77.3%
*-inverses98.3%
metadata-eval98.3%
sub-neg98.3%
metadata-eval98.3%
metadata-eval98.3%
+-commutative98.3%
metadata-eval98.3%
associate-/l/98.4%
Simplified98.4%
Taylor expanded in t around 0 86.2%
associate-*r/86.2%
metadata-eval86.2%
Simplified86.2%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= t -2.65e-12) -2.0 (if (<= t 0.0002) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.65e-12) {
tmp = -2.0;
} else if (t <= 0.0002) {
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 <= (-2.65d-12)) then
tmp = -2.0d0
else if (t <= 0.0002d0) 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 <= -2.65e-12) {
tmp = -2.0;
} else if (t <= 0.0002) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.65e-12: tmp = -2.0 elif t <= 0.0002: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.65e-12) tmp = -2.0; elseif (t <= 0.0002) 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 <= -2.65e-12) tmp = -2.0; elseif (t <= 0.0002) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.65e-12], -2.0, If[LessEqual[t, 0.0002], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.65 \cdot 10^{-12}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 0.0002:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -2.64999999999999982e-12 or 2.0000000000000001e-4 < t Initial program 81.5%
+-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
distribute-rgt1-in81.5%
*-commutative81.5%
times-frac81.7%
fma-def81.6%
*-commutative81.6%
fma-def81.6%
Simplified81.6%
Taylor expanded in z around 0 99.7%
fma-udef99.7%
associate--l+99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 61.9%
associate-+r-61.9%
associate-*r/61.9%
associate-*l/61.8%
associate-+r-61.8%
Simplified61.8%
Taylor expanded in t around inf 37.3%
if -2.64999999999999982e-12 < t < 2.0000000000000001e-4Initial program 98.2%
sub-neg98.2%
distribute-rgt-in98.2%
*-lft-identity98.2%
associate-+r+98.2%
cancel-sign-sub-inv98.2%
div-sub76.1%
associate-*r*76.1%
associate-*l/76.1%
*-inverses98.2%
metadata-eval98.2%
sub-neg98.2%
metadata-eval98.2%
metadata-eval98.2%
+-commutative98.2%
metadata-eval98.2%
associate-/l/98.3%
Simplified98.3%
Taylor expanded in t around 0 85.5%
associate-*r/85.5%
metadata-eval85.5%
Simplified85.5%
Taylor expanded in z around inf 39.1%
Final simplification38.2%
(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 90.1%
+-commutative90.1%
*-commutative90.1%
associate-*r*90.1%
distribute-rgt1-in90.1%
*-commutative90.1%
times-frac90.2%
fma-def91.0%
*-commutative91.0%
fma-def91.0%
Simplified91.0%
Taylor expanded in z around 0 99.8%
fma-udef99.0%
associate--l+99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 74.0%
associate-+r-74.0%
associate-*r/74.0%
associate-*l/74.0%
associate-+r-74.0%
Simplified74.0%
Taylor expanded in t around inf 19.6%
Final simplification19.6%
(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 2023224
(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))))