
(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 11 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 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -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 = (x / y) + (((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} + -2\right)
\end{array}
Initial program 85.8%
+-commutative85.8%
remove-double-neg85.8%
distribute-frac-neg85.8%
unsub-neg85.8%
*-commutative85.8%
associate-*r*85.8%
distribute-rgt1-in85.8%
associate-/l*85.7%
fma-neg85.7%
*-commutative85.7%
fma-define85.7%
*-commutative85.7%
distribute-frac-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in t around inf 99.1%
sub-neg99.1%
+-commutative99.1%
metadata-eval99.1%
associate-+l+99.1%
associate-*r/99.1%
distribute-lft-in99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -1.75e-11)
(/ x y)
(if (<= (/ x y) -9.6e-191)
-2.0
(if (<= (/ x y) 3.8e-285)
(/ 2.0 t)
(if (<= (/ x y) 6.2e-149)
-2.0
(if (<= (/ x y) 2.2e-53)
(/ 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) <= -1.75e-11) {
tmp = x / y;
} else if ((x / y) <= -9.6e-191) {
tmp = -2.0;
} else if ((x / y) <= 3.8e-285) {
tmp = 2.0 / t;
} else if ((x / y) <= 6.2e-149) {
tmp = -2.0;
} else if ((x / y) <= 2.2e-53) {
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) <= (-1.75d-11)) then
tmp = x / y
else if ((x / y) <= (-9.6d-191)) then
tmp = -2.0d0
else if ((x / y) <= 3.8d-285) then
tmp = 2.0d0 / t
else if ((x / y) <= 6.2d-149) then
tmp = -2.0d0
else if ((x / y) <= 2.2d-53) 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) <= -1.75e-11) {
tmp = x / y;
} else if ((x / y) <= -9.6e-191) {
tmp = -2.0;
} else if ((x / y) <= 3.8e-285) {
tmp = 2.0 / t;
} else if ((x / y) <= 6.2e-149) {
tmp = -2.0;
} else if ((x / y) <= 2.2e-53) {
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) <= -1.75e-11: tmp = x / y elif (x / y) <= -9.6e-191: tmp = -2.0 elif (x / y) <= 3.8e-285: tmp = 2.0 / t elif (x / y) <= 6.2e-149: tmp = -2.0 elif (x / y) <= 2.2e-53: 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) <= -1.75e-11) tmp = Float64(x / y); elseif (Float64(x / y) <= -9.6e-191) tmp = -2.0; elseif (Float64(x / y) <= 3.8e-285) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 6.2e-149) tmp = -2.0; elseif (Float64(x / y) <= 2.2e-53) 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) <= -1.75e-11) tmp = x / y; elseif ((x / y) <= -9.6e-191) tmp = -2.0; elseif ((x / y) <= 3.8e-285) tmp = 2.0 / t; elseif ((x / y) <= 6.2e-149) tmp = -2.0; elseif ((x / y) <= 2.2e-53) 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], -1.75e-11], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -9.6e-191], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 3.8e-285], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 6.2e-149], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 2.2e-53], 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 -1.75 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -9.6 \cdot 10^{-191}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 3.8 \cdot 10^{-285}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 6.2 \cdot 10^{-149}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 2.2 \cdot 10^{-53}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.7500000000000001e-11 or 2 < (/.f64 x y) Initial program 79.9%
Taylor expanded in x around inf 66.1%
if -1.7500000000000001e-11 < (/.f64 x y) < -9.5999999999999997e-191 or 3.8000000000000002e-285 < (/.f64 x y) < 6.19999999999999974e-149 or 2.20000000000000018e-53 < (/.f64 x y) < 2Initial program 86.8%
+-commutative86.8%
remove-double-neg86.8%
distribute-frac-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-*r*86.8%
distribute-rgt1-in86.8%
associate-/l*86.7%
fma-neg86.7%
*-commutative86.7%
fma-define86.7%
*-commutative86.7%
distribute-frac-neg86.7%
remove-double-neg86.7%
Simplified86.7%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.5%
associate--l+99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-+r-99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
+-commutative99.5%
metadata-eval99.5%
associate-*l/99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*l/99.4%
associate-/l*99.4%
distribute-lft-in99.4%
associate-*l/99.4%
*-lft-identity99.4%
Simplified99.4%
Taylor expanded in z around inf 66.7%
Taylor expanded in t around inf 49.3%
if -9.5999999999999997e-191 < (/.f64 x y) < 3.8000000000000002e-285 or 6.19999999999999974e-149 < (/.f64 x y) < 2.20000000000000018e-53Initial program 95.5%
Taylor expanded in t around 0 80.0%
associate-*r/80.0%
metadata-eval80.0%
Simplified80.0%
Taylor expanded in z around inf 38.7%
Final simplification54.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)) (t_2 (+ -2.0 (/ (/ 2.0 z) t))))
(if (<= (/ x y) -1580.0)
t_1
(if (<= (/ x y) -1.6e-176)
t_2
(if (<= (/ x y) -1.55e-208)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 1.7e+97) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + ((2.0 / z) / t);
double tmp;
if ((x / y) <= -1580.0) {
tmp = t_1;
} else if ((x / y) <= -1.6e-176) {
tmp = t_2;
} else if ((x / y) <= -1.55e-208) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 1.7e+97) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) - 2.0d0
t_2 = (-2.0d0) + ((2.0d0 / z) / t)
if ((x / y) <= (-1580.0d0)) then
tmp = t_1
else if ((x / y) <= (-1.6d-176)) then
tmp = t_2
else if ((x / y) <= (-1.55d-208)) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 1.7d+97) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double t_2 = -2.0 + ((2.0 / z) / t);
double tmp;
if ((x / y) <= -1580.0) {
tmp = t_1;
} else if ((x / y) <= -1.6e-176) {
tmp = t_2;
} else if ((x / y) <= -1.55e-208) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 1.7e+97) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 t_2 = -2.0 + ((2.0 / z) / t) tmp = 0 if (x / y) <= -1580.0: tmp = t_1 elif (x / y) <= -1.6e-176: tmp = t_2 elif (x / y) <= -1.55e-208: tmp = -2.0 + (2.0 / t) elif (x / y) <= 1.7e+97: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) t_2 = Float64(-2.0 + Float64(Float64(2.0 / z) / t)) tmp = 0.0 if (Float64(x / y) <= -1580.0) tmp = t_1; elseif (Float64(x / y) <= -1.6e-176) tmp = t_2; elseif (Float64(x / y) <= -1.55e-208) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 1.7e+97) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; t_2 = -2.0 + ((2.0 / z) / t); tmp = 0.0; if ((x / y) <= -1580.0) tmp = t_1; elseif ((x / y) <= -1.6e-176) tmp = t_2; elseif ((x / y) <= -1.55e-208) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 1.7e+97) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1580.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -1.6e-176], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], -1.55e-208], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.7e+97], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
t_2 := -2 + \frac{\frac{2}{z}}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -1580:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -1.6 \cdot 10^{-176}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq -1.55 \cdot 10^{-208}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.7 \cdot 10^{+97}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1580 or 1.70000000000000005e97 < (/.f64 x y) Initial program 77.5%
Taylor expanded in t around inf 75.7%
if -1580 < (/.f64 x y) < -1.59999999999999992e-176 or -1.5499999999999999e-208 < (/.f64 x y) < 1.70000000000000005e97Initial program 91.3%
+-commutative91.3%
remove-double-neg91.3%
distribute-frac-neg91.3%
unsub-neg91.3%
*-commutative91.3%
associate-*r*91.3%
distribute-rgt1-in91.3%
associate-/l*91.2%
fma-neg91.2%
*-commutative91.2%
fma-define91.2%
*-commutative91.2%
distribute-frac-neg91.2%
remove-double-neg91.2%
Simplified91.2%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.6%
associate--l+97.6%
associate-*r/97.6%
metadata-eval97.6%
associate-+r-97.6%
+-commutative97.6%
sub-neg97.6%
metadata-eval97.6%
+-commutative97.6%
+-commutative97.6%
metadata-eval97.6%
associate-*l/97.6%
*-commutative97.6%
associate-/r*97.5%
associate-*l/97.5%
associate-/l*97.5%
distribute-lft-in97.5%
associate-*l/97.5%
*-lft-identity97.5%
Simplified97.5%
Taylor expanded in z around 0 70.9%
if -1.59999999999999992e-176 < (/.f64 x y) < -1.5499999999999999e-208Initial program 99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt1-in99.8%
associate-/l*99.6%
fma-neg99.6%
*-commutative99.6%
fma-define99.6%
*-commutative99.6%
distribute-frac-neg99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 100.0%
sub-neg100.0%
+-commutative100.0%
metadata-eval100.0%
associate-+l+100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-+r-100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
+-commutative100.0%
metadata-eval100.0%
associate-*l/100.0%
*-commutative100.0%
associate-/r*100.0%
associate-*l/100.0%
associate-/l*100.0%
distribute-lft-in100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Final simplification73.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -10000.0) (not (<= (/ x y) 4.8e+97))) (- (/ x y) 2.0) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -10000.0) || !((x / y) <= 4.8e+97)) {
tmp = (x / y) - 2.0;
} else {
tmp = ((2.0 + (2.0 / z)) / 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) <= (-10000.0d0)) .or. (.not. ((x / y) <= 4.8d+97))) then
tmp = (x / y) - 2.0d0
else
tmp = ((2.0d0 + (2.0d0 / z)) / 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) <= -10000.0) || !((x / y) <= 4.8e+97)) {
tmp = (x / y) - 2.0;
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -10000.0) or not ((x / y) <= 4.8e+97): tmp = (x / y) - 2.0 else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -10000.0) || !(Float64(x / y) <= 4.8e+97)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -10000.0) || ~(((x / y) <= 4.8e+97))) tmp = (x / y) - 2.0; else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -10000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.8e+97]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10000 \lor \neg \left(\frac{x}{y} \leq 4.8 \cdot 10^{+97}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1e4 or 4.8e97 < (/.f64 x y) Initial program 77.5%
Taylor expanded in t around inf 75.7%
if -1e4 < (/.f64 x y) < 4.8e97Initial program 91.8%
+-commutative91.8%
remove-double-neg91.8%
distribute-frac-neg91.8%
unsub-neg91.8%
*-commutative91.8%
associate-*r*91.8%
distribute-rgt1-in91.8%
associate-/l*91.7%
fma-neg91.7%
*-commutative91.7%
fma-define91.7%
*-commutative91.7%
distribute-frac-neg91.7%
remove-double-neg91.7%
Simplified91.7%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.8%
associate--l+97.8%
associate-*r/97.8%
metadata-eval97.8%
associate-+r-97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
+-commutative97.8%
metadata-eval97.8%
associate-*l/97.8%
*-commutative97.8%
associate-/r*97.7%
associate-*l/97.7%
associate-/l*97.6%
distribute-lft-in97.6%
associate-*l/97.7%
*-lft-identity97.7%
Simplified97.7%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -810.0) (not (<= (/ x y) 1.12e+98))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -810.0) || !((x / y) <= 1.12e+98)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / 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) <= (-810.0d0)) .or. (.not. ((x / y) <= 1.12d+98))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = ((2.0d0 + (2.0d0 / z)) / 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) <= -810.0) || !((x / y) <= 1.12e+98)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -810.0) or not ((x / y) <= 1.12e+98): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -810.0) || !(Float64(x / y) <= 1.12e+98)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -810.0) || ~(((x / y) <= 1.12e+98))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -810.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.12e+98]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -810 \lor \neg \left(\frac{x}{y} \leq 1.12 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -810 or 1.12e98 < (/.f64 x y) Initial program 77.5%
Taylor expanded in z around inf 83.3%
div-sub83.3%
sub-neg83.3%
*-inverses83.3%
metadata-eval83.3%
distribute-lft-in83.3%
associate-*r/83.3%
metadata-eval83.3%
metadata-eval83.3%
Simplified83.3%
if -810 < (/.f64 x y) < 1.12e98Initial program 91.8%
+-commutative91.8%
remove-double-neg91.8%
distribute-frac-neg91.8%
unsub-neg91.8%
*-commutative91.8%
associate-*r*91.8%
distribute-rgt1-in91.8%
associate-/l*91.7%
fma-neg91.7%
*-commutative91.7%
fma-define91.7%
*-commutative91.7%
distribute-frac-neg91.7%
remove-double-neg91.7%
Simplified91.7%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.8%
associate--l+97.8%
associate-*r/97.8%
metadata-eval97.8%
associate-+r-97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
+-commutative97.8%
metadata-eval97.8%
associate-*l/97.8%
*-commutative97.8%
associate-/r*97.7%
associate-*l/97.7%
associate-/l*97.6%
distribute-lft-in97.6%
associate-*l/97.7%
*-lft-identity97.7%
Simplified97.7%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -10000.0) (not (<= (/ x y) 3.5e+90))) (+ (/ x y) (/ 2.0 (* z t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -10000.0) || !((x / y) <= 3.5e+90)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) / 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) <= (-10000.0d0)) .or. (.not. ((x / y) <= 3.5d+90))) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = ((2.0d0 + (2.0d0 / z)) / 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) <= -10000.0) || !((x / y) <= 3.5e+90)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -10000.0) or not ((x / y) <= 3.5e+90): tmp = (x / y) + (2.0 / (z * t)) else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -10000.0) || !(Float64(x / y) <= 3.5e+90)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -10000.0) || ~(((x / y) <= 3.5e+90))) tmp = (x / y) + (2.0 / (z * t)); else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -10000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.5e+90]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10000 \lor \neg \left(\frac{x}{y} \leq 3.5 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1e4 or 3.4999999999999998e90 < (/.f64 x y) Initial program 77.7%
Taylor expanded in z around 0 87.6%
if -1e4 < (/.f64 x y) < 3.4999999999999998e90Initial program 91.7%
+-commutative91.7%
remove-double-neg91.7%
distribute-frac-neg91.7%
unsub-neg91.7%
*-commutative91.7%
associate-*r*91.7%
distribute-rgt1-in91.7%
associate-/l*91.6%
fma-neg91.6%
*-commutative91.6%
fma-define91.6%
*-commutative91.6%
distribute-frac-neg91.6%
remove-double-neg91.6%
Simplified91.6%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.7%
associate--l+97.7%
associate-*r/97.7%
metadata-eval97.7%
associate-+r-97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
+-commutative97.7%
+-commutative97.7%
metadata-eval97.7%
associate-*l/97.7%
*-commutative97.7%
associate-/r*97.6%
associate-*l/97.6%
associate-/l*97.6%
distribute-lft-in97.6%
associate-*l/97.6%
*-lft-identity97.6%
Simplified97.6%
Final simplification93.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.75e-11) (not (<= (/ x y) 2.45e+91))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.75e-11) || !((x / y) <= 2.45e+91)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1.75d-11)) .or. (.not. ((x / y) <= 2.45d+91))) then
tmp = x / y
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.75e-11) || !((x / y) <= 2.45e+91)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.75e-11) or not ((x / y) <= 2.45e+91): tmp = x / y else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.75e-11) || !(Float64(x / y) <= 2.45e+91)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.75e-11) || ~(((x / y) <= 2.45e+91))) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.75e-11], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.45e+91]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.75 \cdot 10^{-11} \lor \neg \left(\frac{x}{y} \leq 2.45 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.7500000000000001e-11 or 2.45000000000000015e91 < (/.f64 x y) Initial program 78.1%
Taylor expanded in x around inf 72.2%
if -1.7500000000000001e-11 < (/.f64 x y) < 2.45000000000000015e91Initial program 91.6%
+-commutative91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
unsub-neg91.6%
*-commutative91.6%
associate-*r*91.6%
distribute-rgt1-in91.6%
associate-/l*91.5%
fma-neg91.5%
*-commutative91.5%
fma-define91.5%
*-commutative91.5%
distribute-frac-neg91.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.7%
associate--l+97.7%
associate-*r/97.7%
metadata-eval97.7%
associate-+r-97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
+-commutative97.7%
+-commutative97.7%
metadata-eval97.7%
associate-*l/97.7%
*-commutative97.7%
associate-/r*97.6%
associate-*l/97.6%
associate-/l*97.6%
distribute-lft-in97.6%
associate-*l/97.6%
*-lft-identity97.6%
Simplified97.6%
Taylor expanded in z around inf 59.8%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.75e-11) (not (<= (/ x y) 3.5e+90))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.75e-11) || !((x / y) <= 3.5e+90)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1.75d-11)) .or. (.not. ((x / y) <= 3.5d+90))) then
tmp = (x / y) - 2.0d0
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.75e-11) || !((x / y) <= 3.5e+90)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.75e-11) or not ((x / y) <= 3.5e+90): tmp = (x / y) - 2.0 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.75e-11) || !(Float64(x / y) <= 3.5e+90)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.75e-11) || ~(((x / y) <= 3.5e+90))) tmp = (x / y) - 2.0; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.75e-11], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.5e+90]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.75 \cdot 10^{-11} \lor \neg \left(\frac{x}{y} \leq 3.5 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.7500000000000001e-11 or 3.4999999999999998e90 < (/.f64 x y) Initial program 78.1%
Taylor expanded in t around inf 73.7%
if -1.7500000000000001e-11 < (/.f64 x y) < 3.4999999999999998e90Initial program 91.6%
+-commutative91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
unsub-neg91.6%
*-commutative91.6%
associate-*r*91.6%
distribute-rgt1-in91.6%
associate-/l*91.5%
fma-neg91.5%
*-commutative91.5%
fma-define91.5%
*-commutative91.5%
distribute-frac-neg91.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in t around inf 99.8%
sub-neg99.8%
+-commutative99.8%
metadata-eval99.8%
associate-+l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 97.7%
associate--l+97.7%
associate-*r/97.7%
metadata-eval97.7%
associate-+r-97.7%
+-commutative97.7%
sub-neg97.7%
metadata-eval97.7%
+-commutative97.7%
+-commutative97.7%
metadata-eval97.7%
associate-*l/97.7%
*-commutative97.7%
associate-/r*97.6%
associate-*l/97.6%
associate-/l*97.6%
distribute-lft-in97.6%
associate-*l/97.6%
*-lft-identity97.6%
Simplified97.6%
Taylor expanded in z around inf 59.8%
Final simplification65.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -320.0) (not (<= t 0.00125))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -320.0) || !(t <= 0.00125)) {
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 <= (-320.0d0)) .or. (.not. (t <= 0.00125d0))) 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 <= -320.0) || !(t <= 0.00125)) {
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 <= -320.0) or not (t <= 0.00125): 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 <= -320.0) || !(t <= 0.00125)) 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 <= -320.0) || ~((t <= 0.00125))) 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, -320.0], N[Not[LessEqual[t, 0.00125]], $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 -320 \lor \neg \left(t \leq 0.00125\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -320 or 0.00125000000000000003 < t Initial program 74.4%
Taylor expanded in t around inf 82.6%
if -320 < t < 0.00125000000000000003Initial program 98.1%
Taylor expanded in t around 0 83.9%
associate-*r/83.9%
metadata-eval83.9%
Simplified83.9%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (<= t -82000.0) -2.0 (if (<= t 900.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -82000.0) {
tmp = -2.0;
} else if (t <= 900.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-82000.0d0)) then
tmp = -2.0d0
else if (t <= 900.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -82000.0) {
tmp = -2.0;
} else if (t <= 900.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -82000.0: tmp = -2.0 elif t <= 900.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -82000.0) tmp = -2.0; elseif (t <= 900.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -82000.0) tmp = -2.0; elseif (t <= 900.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -82000.0], -2.0, If[LessEqual[t, 900.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -82000:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 900:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -82000 or 900 < t Initial program 73.4%
+-commutative73.4%
remove-double-neg73.4%
distribute-frac-neg73.4%
unsub-neg73.4%
*-commutative73.4%
associate-*r*73.4%
distribute-rgt1-in73.4%
associate-/l*73.3%
fma-neg73.3%
*-commutative73.3%
fma-define73.3%
*-commutative73.3%
distribute-frac-neg73.3%
remove-double-neg73.3%
Simplified73.3%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 52.9%
associate--l+52.9%
associate-*r/52.9%
metadata-eval52.9%
associate-+r-52.9%
+-commutative52.9%
sub-neg52.9%
metadata-eval52.9%
+-commutative52.9%
+-commutative52.9%
metadata-eval52.9%
associate-*l/52.9%
*-commutative52.9%
associate-/r*52.9%
associate-*l/52.9%
associate-/l*52.8%
distribute-lft-in52.8%
associate-*l/52.8%
*-lft-identity52.8%
Simplified52.8%
Taylor expanded in z around inf 36.1%
Taylor expanded in t around inf 36.0%
if -82000 < t < 900Initial program 98.2%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
Taylor expanded in z around inf 40.2%
Final simplification38.1%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 85.8%
+-commutative85.8%
remove-double-neg85.8%
distribute-frac-neg85.8%
unsub-neg85.8%
*-commutative85.8%
associate-*r*85.8%
distribute-rgt1-in85.8%
associate-/l*85.7%
fma-neg85.7%
*-commutative85.7%
fma-define85.7%
*-commutative85.7%
distribute-frac-neg85.7%
remove-double-neg85.7%
Simplified85.7%
Taylor expanded in t around inf 99.1%
sub-neg99.1%
+-commutative99.1%
metadata-eval99.1%
associate-+l+99.1%
associate-*r/99.1%
distribute-lft-in99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 66.9%
associate--l+66.9%
associate-*r/66.9%
metadata-eval66.9%
associate-+r-66.9%
+-commutative66.9%
sub-neg66.9%
metadata-eval66.9%
+-commutative66.9%
+-commutative66.9%
metadata-eval66.9%
associate-*l/66.9%
*-commutative66.9%
associate-/r*66.9%
associate-*l/66.9%
associate-/l*66.9%
distribute-lft-in66.9%
associate-*l/66.9%
*-lft-identity66.9%
Simplified66.9%
Taylor expanded in z around inf 38.3%
Taylor expanded in t around inf 19.2%
Final simplification19.2%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024039
(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))))