
(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 (- (+ (* 2.0 (/ 1.0 t)) (+ (/ 2.0 (* t z)) (/ x y))) 2.0))
double code(double x, double y, double z, double t) {
return ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 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 * (1.0d0 / t)) + ((2.0d0 / (t * z)) + (x / y))) - 2.0d0
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 2.0;
}
def code(x, y, z, t): return ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 2.0
function code(x, y, z, t) return Float64(Float64(Float64(2.0 * Float64(1.0 / t)) + Float64(Float64(2.0 / Float64(t * z)) + Float64(x / y))) - 2.0) end
function tmp = code(x, y, z, t) tmp = ((2.0 * (1.0 / t)) + ((2.0 / (t * z)) + (x / y))) - 2.0; end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 * N[(1.0 / t), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot \frac{1}{t} + \left(\frac{2}{t \cdot z} + \frac{x}{y}\right)\right) - 2
\end{array}
Initial program 83.8%
Taylor expanded in t around inf 99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= (/ x y) -35.0)
t_1
(if (<= (/ x y) 2.25e-307)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 4.8e+72) (- (/ (/ 2.0 t) z) 2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if ((x / y) <= -35.0) {
tmp = t_1;
} else if ((x / y) <= 2.25e-307) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4.8e+72) {
tmp = ((2.0 / t) / z) - 2.0;
} 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 ((x / y) <= (-35.0d0)) then
tmp = t_1
else if ((x / y) <= 2.25d-307) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 4.8d+72) then
tmp = ((2.0d0 / t) / z) - 2.0d0
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 ((x / y) <= -35.0) {
tmp = t_1;
} else if ((x / y) <= 2.25e-307) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4.8e+72) {
tmp = ((2.0 / t) / z) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if (x / y) <= -35.0: tmp = t_1 elif (x / y) <= 2.25e-307: tmp = -2.0 + (2.0 / t) elif (x / y) <= 4.8e+72: tmp = ((2.0 / t) / z) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (Float64(x / y) <= -35.0) tmp = t_1; elseif (Float64(x / y) <= 2.25e-307) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 4.8e+72) tmp = Float64(Float64(Float64(2.0 / t) / z) - 2.0); 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 ((x / y) <= -35.0) tmp = t_1; elseif ((x / y) <= 2.25e-307) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 4.8e+72) tmp = ((2.0 / t) / z) - 2.0; 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[N[(x / y), $MachinePrecision], -35.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2.25e-307], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.8e+72], N[(N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;\frac{x}{y} \leq -35:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2.25 \cdot 10^{-307}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.8 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{2}{t}}{z} - 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -35 or 4.8000000000000002e72 < (/.f64 x y) Initial program 83.0%
Taylor expanded in t around inf 73.6%
if -35 < (/.f64 x y) < 2.24999999999999994e-307Initial program 83.9%
Taylor expanded in z around inf 81.5%
div-sub81.6%
sub-neg81.6%
*-inverses81.6%
metadata-eval81.6%
distribute-lft-in81.6%
associate-*r/81.6%
metadata-eval81.6%
metadata-eval81.6%
Simplified81.6%
Taylor expanded in x around 0 80.6%
sub-neg80.6%
associate-*r/80.6%
metadata-eval80.6%
metadata-eval80.6%
Simplified80.6%
if 2.24999999999999994e-307 < (/.f64 x y) < 4.8000000000000002e72Initial program 85.2%
Taylor expanded in t around inf 99.8%
Taylor expanded in z around 0 68.6%
associate-/r*68.6%
Simplified68.6%
Final simplification74.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= (/ x y) -400.0)
t_1
(if (<= (/ x y) 2.5e-307)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 4.8e+72) (- (/ 2.0 (* t z)) 2.0) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if ((x / y) <= -400.0) {
tmp = t_1;
} else if ((x / y) <= 2.5e-307) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4.8e+72) {
tmp = (2.0 / (t * z)) - 2.0;
} 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 ((x / y) <= (-400.0d0)) then
tmp = t_1
else if ((x / y) <= 2.5d-307) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 4.8d+72) then
tmp = (2.0d0 / (t * z)) - 2.0d0
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 ((x / y) <= -400.0) {
tmp = t_1;
} else if ((x / y) <= 2.5e-307) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4.8e+72) {
tmp = (2.0 / (t * z)) - 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if (x / y) <= -400.0: tmp = t_1 elif (x / y) <= 2.5e-307: tmp = -2.0 + (2.0 / t) elif (x / y) <= 4.8e+72: tmp = (2.0 / (t * z)) - 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (Float64(x / y) <= -400.0) tmp = t_1; elseif (Float64(x / y) <= 2.5e-307) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 4.8e+72) tmp = Float64(Float64(2.0 / Float64(t * z)) - 2.0); 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 ((x / y) <= -400.0) tmp = t_1; elseif ((x / y) <= 2.5e-307) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 4.8e+72) tmp = (2.0 / (t * z)) - 2.0; 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[N[(x / y), $MachinePrecision], -400.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2.5e-307], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.8e+72], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;\frac{x}{y} \leq -400:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2.5 \cdot 10^{-307}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.8 \cdot 10^{+72}:\\
\;\;\;\;\frac{2}{t \cdot z} - 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -400 or 4.8000000000000002e72 < (/.f64 x y) Initial program 83.0%
Taylor expanded in t around inf 73.6%
if -400 < (/.f64 x y) < 2.50000000000000007e-307Initial program 83.9%
Taylor expanded in z around inf 81.5%
div-sub81.6%
sub-neg81.6%
*-inverses81.6%
metadata-eval81.6%
distribute-lft-in81.6%
associate-*r/81.6%
metadata-eval81.6%
metadata-eval81.6%
Simplified81.6%
Taylor expanded in x around 0 80.6%
sub-neg80.6%
associate-*r/80.6%
metadata-eval80.6%
metadata-eval80.6%
Simplified80.6%
if 2.50000000000000007e-307 < (/.f64 x y) < 4.8000000000000002e72Initial program 85.2%
Taylor expanded in t around inf 99.8%
Taylor expanded in z around 0 68.6%
*-commutative68.6%
Simplified68.6%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -6200000000.0) (/ x y) (if (<= (/ x y) -3e-42) (/ 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) <= -6200000000.0) {
tmp = x / y;
} else if ((x / y) <= -3e-42) {
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) <= (-6200000000.0d0)) then
tmp = x / y
else if ((x / y) <= (-3d-42)) 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) <= -6200000000.0) {
tmp = x / y;
} else if ((x / y) <= -3e-42) {
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) <= -6200000000.0: tmp = x / y elif (x / y) <= -3e-42: 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) <= -6200000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -3e-42) 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) <= -6200000000.0) tmp = x / y; elseif ((x / y) <= -3e-42) 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], -6200000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -3e-42], 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 -6200000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -3 \cdot 10^{-42}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -6.2e9 or 2 < (/.f64 x y) Initial program 84.2%
Taylor expanded in x around inf 67.3%
if -6.2e9 < (/.f64 x y) < -3.00000000000000027e-42Initial program 89.7%
Taylor expanded in t around 0 64.8%
associate-*r/64.8%
metadata-eval64.8%
Simplified64.8%
Taylor expanded in z around inf 64.9%
if -3.00000000000000027e-42 < (/.f64 x y) < 2Initial program 82.9%
Taylor expanded in t around inf 100.0%
Taylor expanded in z around 0 75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in z around inf 46.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.12e+14) (not (<= z 1.0))) (+ (/ 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.12e+14) || !(z <= 1.0)) {
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.12d+14)) .or. (.not. (z <= 1.0d0))) 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.12e+14) || !(z <= 1.0)) {
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.12e+14) or not (z <= 1.0): 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.12e+14) || !(z <= 1.0)) 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.12e+14) || ~((z <= 1.0))) 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.12e+14], N[Not[LessEqual[z, 1.0]], $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.12 \cdot 10^{+14} \lor \neg \left(z \leq 1\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.12e14 or 1 < z Initial program 70.1%
Taylor expanded in z around inf 99.9%
div-sub99.9%
sub-neg99.9%
*-inverses99.9%
metadata-eval99.9%
distribute-lft-in99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
if -1.12e14 < z < 1Initial 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.8%
fma-neg99.8%
*-commutative99.8%
fma-define99.8%
*-commutative99.8%
distribute-frac-neg99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 98.9%
sub-neg98.9%
+-commutative98.9%
metadata-eval98.9%
associate-+l+98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 97.6%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -2.1e-30)
t_1
(if (<= t -5.8e-222)
(/ (/ 2.0 t) z)
(if (<= t 1.42e-109) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.1e-30) {
tmp = t_1;
} else if (t <= -5.8e-222) {
tmp = (2.0 / t) / z;
} else if (t <= 1.42e-109) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-2.1d-30)) then
tmp = t_1
else if (t <= (-5.8d-222)) then
tmp = (2.0d0 / t) / z
else if (t <= 1.42d-109) then
tmp = 2.0d0 / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -2.1e-30) {
tmp = t_1;
} else if (t <= -5.8e-222) {
tmp = (2.0 / t) / z;
} else if (t <= 1.42e-109) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -2.1e-30: tmp = t_1 elif t <= -5.8e-222: tmp = (2.0 / t) / z elif t <= 1.42e-109: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -2.1e-30) tmp = t_1; elseif (t <= -5.8e-222) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 1.42e-109) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -2.1e-30) tmp = t_1; elseif (t <= -5.8e-222) tmp = (2.0 / t) / z; elseif (t <= 1.42e-109) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -2.1e-30], t$95$1, If[LessEqual[t, -5.8e-222], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 1.42e-109], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-222}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{-109}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000002e-30 or 1.41999999999999994e-109 < t Initial program 76.2%
Taylor expanded in t around inf 78.4%
if -2.1000000000000002e-30 < t < -5.8000000000000004e-222Initial program 99.7%
+-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
associate-/l*99.7%
fma-neg99.7%
*-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-frac-neg99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in t around inf 99.7%
sub-neg99.7%
+-commutative99.7%
metadata-eval99.7%
associate-+l+99.7%
associate-*r/99.7%
distribute-lft-in99.7%
metadata-eval99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 79.8%
sub-neg79.8%
associate-*r/79.8%
metadata-eval79.8%
associate-*r/79.8%
metadata-eval79.8%
+-commutative79.8%
*-commutative79.8%
metadata-eval79.8%
Simplified79.8%
Taylor expanded in z around 0 50.9%
associate-/r*50.9%
Simplified50.9%
if -5.8000000000000004e-222 < t < 1.41999999999999994e-109Initial program 97.7%
Taylor expanded in t around 0 90.9%
associate-*r/90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in z around inf 65.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -8e-29)
t_1
(if (<= t -9.2e-222)
(/ 2.0 (* t z))
(if (<= t 2.2e-108) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -8e-29) {
tmp = t_1;
} else if (t <= -9.2e-222) {
tmp = 2.0 / (t * z);
} else if (t <= 2.2e-108) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (t <= (-8d-29)) then
tmp = t_1
else if (t <= (-9.2d-222)) then
tmp = 2.0d0 / (t * z)
else if (t <= 2.2d-108) then
tmp = 2.0d0 / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -8e-29) {
tmp = t_1;
} else if (t <= -9.2e-222) {
tmp = 2.0 / (t * z);
} else if (t <= 2.2e-108) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -8e-29: tmp = t_1 elif t <= -9.2e-222: tmp = 2.0 / (t * z) elif t <= 2.2e-108: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -8e-29) tmp = t_1; elseif (t <= -9.2e-222) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 2.2e-108) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -8e-29) tmp = t_1; elseif (t <= -9.2e-222) tmp = 2.0 / (t * z); elseif (t <= 2.2e-108) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -8e-29], t$95$1, If[LessEqual[t, -9.2e-222], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e-108], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -8 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-222}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-108}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.99999999999999955e-29 or 2.2000000000000001e-108 < t Initial program 76.2%
Taylor expanded in t around inf 78.4%
if -7.99999999999999955e-29 < t < -9.2000000000000005e-222Initial program 99.7%
+-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*r*99.7%
distribute-rgt1-in99.7%
associate-/l*99.7%
fma-neg99.7%
*-commutative99.7%
fma-define99.7%
*-commutative99.7%
distribute-frac-neg99.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in t around inf 99.7%
sub-neg99.7%
+-commutative99.7%
metadata-eval99.7%
associate-+l+99.7%
associate-*r/99.7%
distribute-lft-in99.7%
metadata-eval99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 79.8%
sub-neg79.8%
associate-*r/79.8%
metadata-eval79.8%
associate-*r/79.8%
metadata-eval79.8%
+-commutative79.8%
*-commutative79.8%
metadata-eval79.8%
Simplified79.8%
Taylor expanded in z around 0 50.9%
if -9.2000000000000005e-222 < t < 2.2000000000000001e-108Initial program 97.7%
Taylor expanded in t around 0 90.9%
associate-*r/90.9%
metadata-eval90.9%
Simplified90.9%
Taylor expanded in z around inf 65.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5e-47) (not (<= z 6.3e-89))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e-47) || !(z <= 6.3e-89)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
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 <= (-5d-47)) .or. (.not. (z <= 6.3d-89))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e-47) || !(z <= 6.3e-89)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5e-47) or not (z <= 6.3e-89): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5e-47) || !(z <= 6.3e-89)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5e-47) || ~((z <= 6.3e-89))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5e-47], N[Not[LessEqual[z, 6.3e-89]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-47} \lor \neg \left(z \leq 6.3 \cdot 10^{-89}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -5.00000000000000011e-47 or 6.2999999999999996e-89 < z Initial program 74.7%
Taylor expanded in z around inf 97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
distribute-lft-in97.3%
associate-*r/97.3%
metadata-eval97.3%
metadata-eval97.3%
Simplified97.3%
if -5.00000000000000011e-47 < z < 6.2999999999999996e-89Initial program 99.8%
Taylor expanded in z around 0 89.8%
associate-/r*89.8%
Simplified89.8%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.05e-50) (not (<= z 1e-89))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (- (/ 2.0 (* t z)) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.05e-50) || !(z <= 1e-89)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / (t * z)) - 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 ((z <= (-2.05d-50)) .or. (.not. (z <= 1d-89))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (2.0d0 / (t * z)) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.05e-50) || !(z <= 1e-89)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 / (t * z)) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.05e-50) or not (z <= 1e-89): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (2.0 / (t * z)) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.05e-50) || !(z <= 1e-89)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(2.0 / Float64(t * z)) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.05e-50) || ~((z <= 1e-89))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (2.0 / (t * z)) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.05e-50], N[Not[LessEqual[z, 1e-89]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-50} \lor \neg \left(z \leq 10^{-89}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} - 2\\
\end{array}
\end{array}
if z < -2.04999999999999993e-50 or 1.00000000000000004e-89 < z Initial program 74.8%
Taylor expanded in z around inf 97.3%
div-sub97.3%
sub-neg97.3%
*-inverses97.3%
metadata-eval97.3%
distribute-lft-in97.3%
associate-*r/97.3%
metadata-eval97.3%
metadata-eval97.3%
Simplified97.3%
if -2.04999999999999993e-50 < z < 1.00000000000000004e-89Initial program 99.8%
Taylor expanded in t around inf 99.8%
Taylor expanded in z around 0 72.0%
*-commutative72.0%
Simplified72.0%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -95.0) (not (<= (/ x y) 7e-8))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -95.0) || !((x / y) <= 7e-8)) {
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) <= (-95.0d0)) .or. (.not. ((x / y) <= 7d-8))) 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) <= -95.0) || !((x / y) <= 7e-8)) {
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) <= -95.0) or not ((x / y) <= 7e-8): 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) <= -95.0) || !(Float64(x / y) <= 7e-8)) 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) <= -95.0) || ~(((x / y) <= 7e-8))) 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], -95.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7e-8]], $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 -95 \lor \neg \left(\frac{x}{y} \leq 7 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -95 or 7.00000000000000048e-8 < (/.f64 x y) Initial program 83.8%
Taylor expanded in t around inf 68.1%
if -95 < (/.f64 x y) < 7.00000000000000048e-8Initial program 83.9%
Taylor expanded in z around inf 72.6%
div-sub72.6%
sub-neg72.6%
*-inverses72.6%
metadata-eval72.6%
distribute-lft-in72.6%
associate-*r/72.6%
metadata-eval72.6%
metadata-eval72.6%
Simplified72.6%
Taylor expanded in x around 0 72.1%
sub-neg72.1%
associate-*r/72.1%
metadata-eval72.1%
metadata-eval72.1%
Simplified72.1%
Final simplification70.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2700000000.0) (not (<= (/ x y) 2.6e+14))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2700000000.0) || !((x / y) <= 2.6e+14)) {
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) <= (-2700000000.0d0)) .or. (.not. ((x / y) <= 2.6d+14))) 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) <= -2700000000.0) || !((x / y) <= 2.6e+14)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2700000000.0) or not ((x / y) <= 2.6e+14): 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) <= -2700000000.0) || !(Float64(x / y) <= 2.6e+14)) 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) <= -2700000000.0) || ~(((x / y) <= 2.6e+14))) 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], -2700000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.6e+14]], $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 -2700000000 \lor \neg \left(\frac{x}{y} \leq 2.6 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.7e9 or 2.6e14 < (/.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 69.1%
if -2.7e9 < (/.f64 x y) < 2.6e14Initial program 84.1%
Taylor expanded in z around inf 72.7%
div-sub72.7%
sub-neg72.7%
*-inverses72.7%
metadata-eval72.7%
distribute-lft-in72.7%
associate-*r/72.7%
metadata-eval72.7%
metadata-eval72.7%
Simplified72.7%
Taylor expanded in x around 0 69.4%
sub-neg69.4%
associate-*r/69.4%
metadata-eval69.4%
metadata-eval69.4%
Simplified69.4%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.2e-9) (not (<= t 3e-17))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.2e-9) || !(t <= 3e-17)) {
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 <= (-8.2d-9)) .or. (.not. (t <= 3d-17))) 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 <= -8.2e-9) || !(t <= 3e-17)) {
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 <= -8.2e-9) or not (t <= 3e-17): 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 <= -8.2e-9) || !(t <= 3e-17)) 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 <= -8.2e-9) || ~((t <= 3e-17))) 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, -8.2e-9], N[Not[LessEqual[t, 3e-17]], $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 -8.2 \cdot 10^{-9} \lor \neg \left(t \leq 3 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -8.2000000000000006e-9 or 3.00000000000000006e-17 < t Initial program 72.9%
Taylor expanded in t around inf 83.5%
if -8.2000000000000006e-9 < t < 3.00000000000000006e-17Initial program 98.8%
Taylor expanded in t around 0 80.8%
associate-*r/80.8%
metadata-eval80.8%
Simplified80.8%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (<= t -1.2e+18) -2.0 (if (<= t 2.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.2e+18) {
tmp = -2.0;
} else if (t <= 2.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 <= (-1.2d+18)) then
tmp = -2.0d0
else if (t <= 2.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 <= -1.2e+18) {
tmp = -2.0;
} else if (t <= 2.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.2e+18: tmp = -2.0 elif t <= 2.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.2e+18) tmp = -2.0; elseif (t <= 2.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 <= -1.2e+18) tmp = -2.0; elseif (t <= 2.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.2e+18], -2.0, If[LessEqual[t, 2.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+18}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 2:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.2e18 or 2 < t Initial program 71.3%
Taylor expanded in t around inf 99.9%
Taylor expanded in z around 0 54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in z around inf 38.9%
if -1.2e18 < t < 2Initial program 98.9%
Taylor expanded in t around 0 76.5%
associate-*r/76.5%
metadata-eval76.5%
Simplified76.5%
Taylor expanded in z around inf 43.6%
(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 83.8%
+-commutative83.8%
remove-double-neg83.8%
distribute-frac-neg83.8%
unsub-neg83.8%
*-commutative83.8%
associate-*r*83.8%
distribute-rgt1-in83.8%
associate-/l*84.6%
fma-neg84.6%
*-commutative84.6%
fma-define84.6%
*-commutative84.6%
distribute-frac-neg84.6%
remove-double-neg84.6%
Simplified84.6%
Taylor expanded in t around inf 99.5%
sub-neg99.5%
+-commutative99.5%
metadata-eval99.5%
associate-+l+99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
(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 83.8%
Taylor expanded in t around inf 99.9%
Taylor expanded in z around 0 45.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in z around inf 22.5%
(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 2024091
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))