
(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 12 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 89.3%
+-commutative89.3%
remove-double-neg89.3%
distribute-frac-neg89.3%
unsub-neg89.3%
*-commutative89.3%
associate-*r*89.3%
distribute-rgt1-in89.3%
associate-/l*89.2%
fma-neg89.2%
*-commutative89.2%
fma-define89.2%
*-commutative89.2%
distribute-frac-neg89.2%
remove-double-neg89.2%
Simplified89.2%
Taylor expanded in t around inf 98.3%
sub-neg98.3%
+-commutative98.3%
metadata-eval98.3%
associate-+l+98.3%
associate-*r/98.3%
distribute-lft-in98.3%
metadata-eval98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -4.2e+48)
t_1
(if (<= z -580000000000.0)
(/ 2.0 t)
(if (<= z -1.02e-43)
(/ x y)
(if (<= z 4.2e-71) (+ -2.0 (/ (/ 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 (z <= -4.2e+48) {
tmp = t_1;
} else if (z <= -580000000000.0) {
tmp = 2.0 / t;
} else if (z <= -1.02e-43) {
tmp = x / y;
} else if (z <= 4.2e-71) {
tmp = -2.0 + ((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 (z <= (-4.2d+48)) then
tmp = t_1
else if (z <= (-580000000000.0d0)) then
tmp = 2.0d0 / t
else if (z <= (-1.02d-43)) then
tmp = x / y
else if (z <= 4.2d-71) then
tmp = (-2.0d0) + ((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 (z <= -4.2e+48) {
tmp = t_1;
} else if (z <= -580000000000.0) {
tmp = 2.0 / t;
} else if (z <= -1.02e-43) {
tmp = x / y;
} else if (z <= 4.2e-71) {
tmp = -2.0 + ((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 z <= -4.2e+48: tmp = t_1 elif z <= -580000000000.0: tmp = 2.0 / t elif z <= -1.02e-43: tmp = x / y elif z <= 4.2e-71: tmp = -2.0 + ((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 (z <= -4.2e+48) tmp = t_1; elseif (z <= -580000000000.0) tmp = Float64(2.0 / t); elseif (z <= -1.02e-43) tmp = Float64(x / y); elseif (z <= 4.2e-71) tmp = Float64(-2.0 + Float64(Float64(2.0 / 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 (z <= -4.2e+48) tmp = t_1; elseif (z <= -580000000000.0) tmp = 2.0 / t; elseif (z <= -1.02e-43) tmp = x / y; elseif (z <= 4.2e-71) tmp = -2.0 + ((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[z, -4.2e+48], t$95$1, If[LessEqual[z, -580000000000.0], N[(2.0 / t), $MachinePrecision], If[LessEqual[z, -1.02e-43], N[(x / y), $MachinePrecision], If[LessEqual[z, 4.2e-71], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -580000000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-71}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.1999999999999997e48 or 4.2000000000000002e-71 < z Initial program 79.8%
Taylor expanded in t around inf 66.2%
if -4.1999999999999997e48 < z < -5.8e11Initial program 99.1%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.2%
if -5.8e11 < z < -1.0200000000000001e-43Initial program 100.0%
Taylor expanded in x around inf 75.6%
if -1.0200000000000001e-43 < z < 4.2000000000000002e-71Initial program 97.3%
+-commutative97.3%
remove-double-neg97.3%
distribute-frac-neg97.3%
unsub-neg97.3%
*-commutative97.3%
associate-*r*97.3%
distribute-rgt1-in97.3%
associate-/l*97.3%
fma-neg97.3%
*-commutative97.3%
fma-define97.3%
*-commutative97.3%
distribute-frac-neg97.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 97.3%
sub-neg97.3%
+-commutative97.3%
metadata-eval97.3%
associate-+l+97.3%
associate-*r/97.3%
distribute-lft-in97.3%
metadata-eval97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in z around 0 97.3%
Taylor expanded in x around 0 84.5%
sub-neg84.5%
associate-*r/84.5%
metadata-eval84.5%
*-commutative84.5%
metadata-eval84.5%
+-commutative84.5%
associate-/r*84.5%
Simplified84.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -1.18e+51)
t_1
(if (<= z -135000000000.0)
(/ 2.0 t)
(if (<= z -2.9e-44) (/ x y) (if (<= z 6.8e-72) (/ (/ 2.0 t) z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -1.18e+51) {
tmp = t_1;
} else if (z <= -135000000000.0) {
tmp = 2.0 / t;
} else if (z <= -2.9e-44) {
tmp = x / y;
} else if (z <= 6.8e-72) {
tmp = (2.0 / t) / z;
} 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 (z <= (-1.18d+51)) then
tmp = t_1
else if (z <= (-135000000000.0d0)) then
tmp = 2.0d0 / t
else if (z <= (-2.9d-44)) then
tmp = x / y
else if (z <= 6.8d-72) then
tmp = (2.0d0 / t) / z
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 (z <= -1.18e+51) {
tmp = t_1;
} else if (z <= -135000000000.0) {
tmp = 2.0 / t;
} else if (z <= -2.9e-44) {
tmp = x / y;
} else if (z <= 6.8e-72) {
tmp = (2.0 / t) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -1.18e+51: tmp = t_1 elif z <= -135000000000.0: tmp = 2.0 / t elif z <= -2.9e-44: tmp = x / y elif z <= 6.8e-72: tmp = (2.0 / t) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -1.18e+51) tmp = t_1; elseif (z <= -135000000000.0) tmp = Float64(2.0 / t); elseif (z <= -2.9e-44) tmp = Float64(x / y); elseif (z <= 6.8e-72) tmp = Float64(Float64(2.0 / t) / z); 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 (z <= -1.18e+51) tmp = t_1; elseif (z <= -135000000000.0) tmp = 2.0 / t; elseif (z <= -2.9e-44) tmp = x / y; elseif (z <= 6.8e-72) tmp = (2.0 / t) / z; 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[z, -1.18e+51], t$95$1, If[LessEqual[z, -135000000000.0], N[(2.0 / t), $MachinePrecision], If[LessEqual[z, -2.9e-44], N[(x / y), $MachinePrecision], If[LessEqual[z, 6.8e-72], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -135000000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-72}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.18e51 or 6.7999999999999997e-72 < z Initial program 79.8%
Taylor expanded in t around inf 66.2%
if -1.18e51 < z < -1.35e11Initial program 99.1%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.2%
if -1.35e11 < z < -2.9000000000000001e-44Initial program 100.0%
Taylor expanded in x around inf 75.6%
if -2.9000000000000001e-44 < z < 6.7999999999999997e-72Initial program 97.3%
+-commutative97.3%
remove-double-neg97.3%
distribute-frac-neg97.3%
unsub-neg97.3%
*-commutative97.3%
associate-*r*97.3%
distribute-rgt1-in97.3%
associate-/l*97.3%
fma-neg97.3%
*-commutative97.3%
fma-define97.3%
*-commutative97.3%
distribute-frac-neg97.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 97.3%
sub-neg97.3%
+-commutative97.3%
metadata-eval97.3%
associate-+l+97.3%
associate-*r/97.3%
distribute-lft-in97.3%
metadata-eval97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in z around 0 71.1%
associate-/r*71.1%
Simplified71.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -4.2e+48)
t_1
(if (<= z -115000000.0)
(/ 2.0 t)
(if (<= z -3.6e-44)
(/ x y)
(if (<= z 1.65e-71) (/ 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 (z <= -4.2e+48) {
tmp = t_1;
} else if (z <= -115000000.0) {
tmp = 2.0 / t;
} else if (z <= -3.6e-44) {
tmp = x / y;
} else if (z <= 1.65e-71) {
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 (z <= (-4.2d+48)) then
tmp = t_1
else if (z <= (-115000000.0d0)) then
tmp = 2.0d0 / t
else if (z <= (-3.6d-44)) then
tmp = x / y
else if (z <= 1.65d-71) 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 (z <= -4.2e+48) {
tmp = t_1;
} else if (z <= -115000000.0) {
tmp = 2.0 / t;
} else if (z <= -3.6e-44) {
tmp = x / y;
} else if (z <= 1.65e-71) {
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 z <= -4.2e+48: tmp = t_1 elif z <= -115000000.0: tmp = 2.0 / t elif z <= -3.6e-44: tmp = x / y elif z <= 1.65e-71: 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 (z <= -4.2e+48) tmp = t_1; elseif (z <= -115000000.0) tmp = Float64(2.0 / t); elseif (z <= -3.6e-44) tmp = Float64(x / y); elseif (z <= 1.65e-71) 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 (z <= -4.2e+48) tmp = t_1; elseif (z <= -115000000.0) tmp = 2.0 / t; elseif (z <= -3.6e-44) tmp = x / y; elseif (z <= 1.65e-71) 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[z, -4.2e+48], t$95$1, If[LessEqual[z, -115000000.0], N[(2.0 / t), $MachinePrecision], If[LessEqual[z, -3.6e-44], N[(x / y), $MachinePrecision], If[LessEqual[z, 1.65e-71], 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}\;z \leq -4.2 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -115000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-71}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.1999999999999997e48 or 1.6500000000000001e-71 < z Initial program 79.8%
Taylor expanded in t around inf 66.2%
if -4.1999999999999997e48 < z < -1.15e8Initial program 99.1%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.2%
if -1.15e8 < z < -3.5999999999999999e-44Initial program 100.0%
Taylor expanded in x around inf 75.6%
if -3.5999999999999999e-44 < z < 1.6500000000000001e-71Initial program 97.3%
+-commutative97.3%
remove-double-neg97.3%
distribute-frac-neg97.3%
unsub-neg97.3%
*-commutative97.3%
associate-*r*97.3%
distribute-rgt1-in97.3%
associate-/l*97.3%
fma-neg97.3%
*-commutative97.3%
fma-define97.3%
*-commutative97.3%
distribute-frac-neg97.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 97.3%
sub-neg97.3%
+-commutative97.3%
metadata-eval97.3%
associate-+l+97.3%
associate-*r/97.3%
distribute-lft-in97.3%
metadata-eval97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in z around 0 71.1%
Final simplification69.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (+ -2.0 (/ 2.0 t)))))
(if (<= z -0.00094)
t_1
(if (<= z 8.5e-105)
(+ (/ x y) (/ 2.0 (* z t)))
(if (<= z 1.8e-71) (+ -2.0 (/ (/ 2.0 z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -0.00094) {
tmp = t_1;
} else if (z <= 8.5e-105) {
tmp = (x / y) + (2.0 / (z * t));
} else if (z <= 1.8e-71) {
tmp = -2.0 + ((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) + (2.0d0 / t))
if (z <= (-0.00094d0)) then
tmp = t_1
else if (z <= 8.5d-105) then
tmp = (x / y) + (2.0d0 / (z * t))
else if (z <= 1.8d-71) then
tmp = (-2.0d0) + ((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 + (2.0 / t));
double tmp;
if (z <= -0.00094) {
tmp = t_1;
} else if (z <= 8.5e-105) {
tmp = (x / y) + (2.0 / (z * t));
} else if (z <= 1.8e-71) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if z <= -0.00094: tmp = t_1 elif z <= 8.5e-105: tmp = (x / y) + (2.0 / (z * t)) elif z <= 1.8e-71: tmp = -2.0 + ((2.0 / z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (z <= -0.00094) tmp = t_1; elseif (z <= 8.5e-105) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); elseif (z <= 1.8e-71) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if (z <= -0.00094) tmp = t_1; elseif (z <= 8.5e-105) tmp = (x / y) + (2.0 / (z * t)); elseif (z <= 1.8e-71) tmp = -2.0 + ((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[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00094], t$95$1, If[LessEqual[z, 8.5e-105], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-71], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;z \leq -0.00094:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-71}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.39999999999999972e-4 or 1.8e-71 < z Initial program 81.2%
Taylor expanded in z around inf 94.9%
div-sub94.9%
sub-neg94.9%
*-inverses94.9%
metadata-eval94.9%
distribute-lft-in94.9%
associate-*r/94.9%
metadata-eval94.9%
metadata-eval94.9%
Simplified94.9%
if -9.39999999999999972e-4 < z < 8.50000000000000038e-105Initial program 98.1%
Taylor expanded in z around 0 87.0%
if 8.50000000000000038e-105 < z < 1.8e-71Initial program 88.7%
+-commutative88.7%
remove-double-neg88.7%
distribute-frac-neg88.7%
unsub-neg88.7%
*-commutative88.7%
associate-*r*88.7%
distribute-rgt1-in88.7%
associate-/l*88.7%
fma-neg88.7%
*-commutative88.7%
fma-define88.7%
*-commutative88.7%
distribute-frac-neg88.7%
remove-double-neg88.7%
Simplified88.7%
Taylor expanded in t around inf 88.9%
sub-neg88.9%
+-commutative88.9%
metadata-eval88.9%
associate-+l+88.9%
associate-*r/88.9%
distribute-lft-in88.9%
metadata-eval88.9%
associate-*r/88.9%
metadata-eval88.9%
Simplified88.9%
Taylor expanded in z around 0 88.9%
Taylor expanded in x around 0 99.8%
sub-neg99.8%
associate-*r/99.8%
metadata-eval99.8%
*-commutative99.8%
metadata-eval99.8%
+-commutative99.8%
associate-/r*100.0%
Simplified100.0%
Final simplification91.4%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -7e+25)
(/ x y)
(if (<= (/ x y) -2.75e-297)
(/ 2.0 t)
(if (<= (/ x y) 42000000000000.0) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -7e+25) {
tmp = x / y;
} else if ((x / y) <= -2.75e-297) {
tmp = 2.0 / t;
} else if ((x / y) <= 42000000000000.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) <= (-7d+25)) then
tmp = x / y
else if ((x / y) <= (-2.75d-297)) then
tmp = 2.0d0 / t
else if ((x / y) <= 42000000000000.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) <= -7e+25) {
tmp = x / y;
} else if ((x / y) <= -2.75e-297) {
tmp = 2.0 / t;
} else if ((x / y) <= 42000000000000.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -7e+25: tmp = x / y elif (x / y) <= -2.75e-297: tmp = 2.0 / t elif (x / y) <= 42000000000000.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -7e+25) tmp = Float64(x / y); elseif (Float64(x / y) <= -2.75e-297) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 42000000000000.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) <= -7e+25) tmp = x / y; elseif ((x / y) <= -2.75e-297) tmp = 2.0 / t; elseif ((x / y) <= 42000000000000.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -7e+25], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2.75e-297], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 42000000000000.0], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -7 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2.75 \cdot 10^{-297}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 42000000000000:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -6.99999999999999999e25 or 4.2e13 < (/.f64 x y) Initial program 84.5%
Taylor expanded in x around inf 63.9%
if -6.99999999999999999e25 < (/.f64 x y) < -2.75000000000000015e-297Initial program 95.7%
Taylor expanded in t around 0 75.6%
associate-*r/75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around inf 34.3%
if -2.75000000000000015e-297 < (/.f64 x y) < 4.2e13Initial 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.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 z around 0 77.9%
Taylor expanded in x around 0 77.2%
sub-neg77.2%
associate-*r/77.2%
metadata-eval77.2%
*-commutative77.2%
metadata-eval77.2%
+-commutative77.2%
associate-/r*77.3%
Simplified77.3%
Taylor expanded in z around inf 39.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 5.3e-5))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (+ -2.0 (/ (/ 2.0 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 5.3e-5)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-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 ((z <= (-1.0d0)) .or. (.not. (z <= 5.3d-5))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((-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 ((z <= -1.0) || !(z <= 5.3e-5)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (-2.0 + ((2.0 / z) / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 5.3e-5): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (-2.0 + ((2.0 / z) / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 5.3e-5)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 5.3e-5))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (-2.0 + ((2.0 / z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 5.3e-5]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 5.3 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{z}}{t}\right)\\
\end{array}
\end{array}
if z < -1 or 5.3000000000000001e-5 < z Initial program 78.1%
Taylor expanded in z around inf 98.9%
div-sub98.9%
sub-neg98.9%
*-inverses98.9%
metadata-eval98.9%
distribute-lft-in98.9%
associate-*r/98.9%
metadata-eval98.9%
metadata-eval98.9%
Simplified98.9%
if -1 < z < 5.3000000000000001e-5Initial program 97.1%
+-commutative97.1%
remove-double-neg97.1%
distribute-frac-neg97.1%
unsub-neg97.1%
*-commutative97.1%
associate-*r*97.1%
distribute-rgt1-in97.1%
associate-/l*97.1%
fma-neg97.1%
*-commutative97.1%
fma-define97.1%
*-commutative97.1%
distribute-frac-neg97.1%
remove-double-neg97.1%
Simplified97.1%
Taylor expanded in t around inf 97.2%
sub-neg97.2%
+-commutative97.2%
metadata-eval97.2%
associate-+l+97.2%
associate-*r/97.2%
distribute-lft-in97.2%
metadata-eval97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in z around 0 96.3%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.4e-36) (not (<= z 1.2e-70))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4e-36) || !(z <= 1.2e-70)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} 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 ((z <= (-3.4d-36)) .or. (.not. (z <= 1.2d-70))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
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 ((z <= -3.4e-36) || !(z <= 1.2e-70)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.4e-36) or not (z <= 1.2e-70): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.4e-36) || !(z <= 1.2e-70)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.4e-36) || ~((z <= 1.2e-70))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4e-36], N[Not[LessEqual[z, 1.2e-70]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-36} \lor \neg \left(z \leq 1.2 \cdot 10^{-70}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -3.4000000000000003e-36 or 1.2000000000000001e-70 < z Initial program 82.0%
Taylor expanded in z around inf 94.4%
div-sub94.4%
sub-neg94.4%
*-inverses94.4%
metadata-eval94.4%
distribute-lft-in94.4%
associate-*r/94.4%
metadata-eval94.4%
metadata-eval94.4%
Simplified94.4%
if -3.4000000000000003e-36 < z < 1.2000000000000001e-70Initial program 97.3%
+-commutative97.3%
remove-double-neg97.3%
distribute-frac-neg97.3%
unsub-neg97.3%
*-commutative97.3%
associate-*r*97.3%
distribute-rgt1-in97.3%
associate-/l*97.3%
fma-neg97.3%
*-commutative97.3%
fma-define97.3%
*-commutative97.3%
distribute-frac-neg97.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 97.3%
sub-neg97.3%
+-commutative97.3%
metadata-eval97.3%
associate-+l+97.3%
associate-*r/97.3%
distribute-lft-in97.3%
metadata-eval97.3%
associate-*r/97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in z around 0 97.3%
Taylor expanded in x around 0 84.0%
sub-neg84.0%
associate-*r/84.0%
metadata-eval84.0%
*-commutative84.0%
metadata-eval84.0%
+-commutative84.0%
associate-/r*84.0%
Simplified84.0%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.3e+45) (not (<= t 2.35e-37))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e+45) || !(t <= 2.35e-37)) {
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 <= (-2.3d+45)) .or. (.not. (t <= 2.35d-37))) 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 <= -2.3e+45) || !(t <= 2.35e-37)) {
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 <= -2.3e+45) or not (t <= 2.35e-37): 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 <= -2.3e+45) || !(t <= 2.35e-37)) 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 <= -2.3e+45) || ~((t <= 2.35e-37))) 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, -2.3e+45], N[Not[LessEqual[t, 2.35e-37]], $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 -2.3 \cdot 10^{+45} \lor \neg \left(t \leq 2.35 \cdot 10^{-37}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -2.30000000000000012e45 or 2.3500000000000001e-37 < t Initial program 80.2%
Taylor expanded in t around inf 78.5%
if -2.30000000000000012e45 < t < 2.3500000000000001e-37Initial program 96.8%
Taylor expanded in t around 0 81.2%
associate-*r/81.2%
metadata-eval81.2%
Simplified81.2%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.95e-20) (not (<= t 2.9e-38))) (- (/ x y) 2.0) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.95e-20) || !(t <= 2.9e-38)) {
tmp = (x / y) - 2.0;
} else {
tmp = 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 <= (-2.95d-20)) .or. (.not. (t <= 2.9d-38))) then
tmp = (x / y) - 2.0d0
else
tmp = 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 <= -2.95e-20) || !(t <= 2.9e-38)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.95e-20) or not (t <= 2.9e-38): tmp = (x / y) - 2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.95e-20) || !(t <= 2.9e-38)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.95e-20) || ~((t <= 2.9e-38))) tmp = (x / y) - 2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.95e-20], N[Not[LessEqual[t, 2.9e-38]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.95 \cdot 10^{-20} \lor \neg \left(t \leq 2.9 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -2.94999999999999983e-20 or 2.89999999999999994e-38 < t Initial program 82.8%
Taylor expanded in t around inf 73.4%
if -2.94999999999999983e-20 < t < 2.89999999999999994e-38Initial program 96.4%
Taylor expanded in t around 0 84.0%
associate-*r/84.0%
metadata-eval84.0%
Simplified84.0%
Taylor expanded in z around inf 36.8%
Final simplification56.1%
(FPCore (x y z t) :precision binary64 (if (<= t -3.5e-18) -2.0 (if (<= t 0.7) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.5e-18) {
tmp = -2.0;
} else if (t <= 0.7) {
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 <= (-3.5d-18)) then
tmp = -2.0d0
else if (t <= 0.7d0) 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 <= -3.5e-18) {
tmp = -2.0;
} else if (t <= 0.7) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.5e-18: tmp = -2.0 elif t <= 0.7: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.5e-18) tmp = -2.0; elseif (t <= 0.7) 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 <= -3.5e-18) tmp = -2.0; elseif (t <= 0.7) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.5e-18], -2.0, If[LessEqual[t, 0.7], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-18}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 0.7:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -3.4999999999999999e-18 or 0.69999999999999996 < t Initial program 82.2%
+-commutative82.2%
remove-double-neg82.2%
distribute-frac-neg82.2%
unsub-neg82.2%
*-commutative82.2%
associate-*r*82.2%
distribute-rgt1-in82.2%
associate-/l*82.1%
fma-neg82.1%
*-commutative82.1%
fma-define82.1%
*-commutative82.1%
distribute-frac-neg82.1%
remove-double-neg82.1%
Simplified82.1%
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 z around 0 99.4%
Taylor expanded in x around 0 61.9%
sub-neg61.9%
associate-*r/61.9%
metadata-eval61.9%
*-commutative61.9%
metadata-eval61.9%
+-commutative61.9%
associate-/r*61.9%
Simplified61.9%
Taylor expanded in z around inf 36.8%
if -3.4999999999999999e-18 < t < 0.69999999999999996Initial program 96.5%
Taylor expanded in t around 0 82.4%
associate-*r/82.4%
metadata-eval82.4%
Simplified82.4%
Taylor expanded in z around inf 36.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 89.3%
+-commutative89.3%
remove-double-neg89.3%
distribute-frac-neg89.3%
unsub-neg89.3%
*-commutative89.3%
associate-*r*89.3%
distribute-rgt1-in89.3%
associate-/l*89.2%
fma-neg89.2%
*-commutative89.2%
fma-define89.2%
*-commutative89.2%
distribute-frac-neg89.2%
remove-double-neg89.2%
Simplified89.2%
Taylor expanded in t around inf 98.3%
sub-neg98.3%
+-commutative98.3%
metadata-eval98.3%
associate-+l+98.3%
associate-*r/98.3%
distribute-lft-in98.3%
metadata-eval98.3%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 80.9%
Taylor expanded in x around 0 54.7%
sub-neg54.7%
associate-*r/54.7%
metadata-eval54.7%
*-commutative54.7%
metadata-eval54.7%
+-commutative54.7%
associate-/r*54.7%
Simplified54.7%
Taylor expanded in z around inf 19.9%
(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 2024116
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))