
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ (+ 2.0 (/ 2.0 z)) t) (+ -2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / 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 + (2.0d0 / z)) / t) + ((-2.0d0) + (x / y))
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y));
}
def code(x, y, z, t): return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + Float64(-2.0 + Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \frac{2}{z}}{t} + \left(-2 + \frac{x}{y}\right)
\end{array}
Initial program 90.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
distribute-lft-out99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+20) (not (<= (/ x y) 2e-17))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* z t))) (+ -2.0 (+ (/ 2.0 t) (/ (/ 2.0 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+20) || !((x / y) <= 2e-17)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((2.0 / t) + ((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 (((x / y) <= (-5d+20)) .or. (.not. ((x / y) <= 2d-17))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (z * t))
else
tmp = (-2.0d0) + ((2.0d0 / t) + ((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 (((x / y) <= -5e+20) || !((x / y) <= 2e-17)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t));
} else {
tmp = -2.0 + ((2.0 / t) + ((2.0 / z) / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+20) or not ((x / y) <= 2e-17): tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)) else: tmp = -2.0 + ((2.0 / t) + ((2.0 / z) / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -5e+20) || !(Float64(x / y) <= 2e-17)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(z * t))); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) + Float64(Float64(2.0 / z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -5e+20) || ~(((x / y) <= 2e-17))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (z * t)); else tmp = -2.0 + ((2.0 / t) + ((2.0 / z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -5e+20], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-17]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+20} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \left(\frac{2}{t} + \frac{\frac{2}{z}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -5e20 or 2.00000000000000014e-17 < (/.f64 x y) Initial program 92.2%
Taylor expanded in t around 0 99.6%
if -5e20 < (/.f64 x y) < 2.00000000000000014e-17Initial program 89.7%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
distribute-lft-out99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
distribute-lft-out99.9%
+-commutative99.9%
distribute-lft-out99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -205000000000.0)
(/ x y)
(if (<= (/ x y) -6.3e-81)
(/ 2.0 t)
(if (<= (/ x y) 9.6e-246)
-2.0
(if (<= (/ x y) 7.5e+90) (/ 2.0 t) (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -205000000000.0) {
tmp = x / y;
} else if ((x / y) <= -6.3e-81) {
tmp = 2.0 / t;
} else if ((x / y) <= 9.6e-246) {
tmp = -2.0;
} else if ((x / y) <= 7.5e+90) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-205000000000.0d0)) then
tmp = x / y
else if ((x / y) <= (-6.3d-81)) then
tmp = 2.0d0 / t
else if ((x / y) <= 9.6d-246) then
tmp = -2.0d0
else if ((x / y) <= 7.5d+90) then
tmp = 2.0d0 / t
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -205000000000.0) {
tmp = x / y;
} else if ((x / y) <= -6.3e-81) {
tmp = 2.0 / t;
} else if ((x / y) <= 9.6e-246) {
tmp = -2.0;
} else if ((x / y) <= 7.5e+90) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -205000000000.0: tmp = x / y elif (x / y) <= -6.3e-81: tmp = 2.0 / t elif (x / y) <= 9.6e-246: tmp = -2.0 elif (x / y) <= 7.5e+90: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -205000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -6.3e-81) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 9.6e-246) tmp = -2.0; elseif (Float64(x / y) <= 7.5e+90) tmp = Float64(2.0 / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -205000000000.0) tmp = x / y; elseif ((x / y) <= -6.3e-81) tmp = 2.0 / t; elseif ((x / y) <= 9.6e-246) tmp = -2.0; elseif ((x / y) <= 7.5e+90) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -205000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -6.3e-81], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 9.6e-246], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 7.5e+90], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -205000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -6.3 \cdot 10^{-81}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 9.6 \cdot 10^{-246}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 7.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.05e11 or 7.50000000000000014e90 < (/.f64 x y) Initial program 90.8%
Taylor expanded in x around inf 69.1%
if -2.05e11 < (/.f64 x y) < -6.30000000000000023e-81 or 9.5999999999999992e-246 < (/.f64 x y) < 7.50000000000000014e90Initial program 97.2%
Taylor expanded in z around inf 56.5%
associate-*r/56.5%
associate-/l*56.5%
Simplified56.5%
Taylor expanded in t around 0 41.9%
Taylor expanded in x around 0 39.3%
if -6.30000000000000023e-81 < (/.f64 x y) < 9.5999999999999992e-246Initial program 84.3%
Taylor expanded in z around inf 59.4%
associate-*r/59.4%
associate-/l*59.4%
Simplified59.4%
Taylor expanded in x around 0 59.4%
div-sub59.4%
sub-neg59.4%
*-inverses59.4%
metadata-eval59.4%
Simplified59.4%
Taylor expanded in t around inf 40.8%
Final simplification51.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))))
(if (or (<= (/ x y) -100000000.0) (not (<= (/ x y) 3.9e+91)))
(+ (/ x y) t_1)
(+ -2.0 (+ (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double tmp;
if (((x / y) <= -100000000.0) || !((x / y) <= 3.9e+91)) {
tmp = (x / y) + t_1;
} else {
tmp = -2.0 + ((2.0 / t) + 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 = 2.0d0 / (z * t)
if (((x / y) <= (-100000000.0d0)) .or. (.not. ((x / y) <= 3.9d+91))) then
tmp = (x / y) + t_1
else
tmp = (-2.0d0) + ((2.0d0 / t) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double tmp;
if (((x / y) <= -100000000.0) || !((x / y) <= 3.9e+91)) {
tmp = (x / y) + t_1;
} else {
tmp = -2.0 + ((2.0 / t) + t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) tmp = 0 if ((x / y) <= -100000000.0) or not ((x / y) <= 3.9e+91): tmp = (x / y) + t_1 else: tmp = -2.0 + ((2.0 / t) + t_1) return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) tmp = 0.0 if ((Float64(x / y) <= -100000000.0) || !(Float64(x / y) <= 3.9e+91)) tmp = Float64(Float64(x / y) + t_1); else tmp = Float64(-2.0 + Float64(Float64(2.0 / t) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); tmp = 0.0; if (((x / y) <= -100000000.0) || ~(((x / y) <= 3.9e+91))) tmp = (x / y) + t_1; else tmp = -2.0 + ((2.0 / t) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x / y), $MachinePrecision], -100000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.9e+91]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -100000000 \lor \neg \left(\frac{x}{y} \leq 3.9 \cdot 10^{+91}\right):\\
\;\;\;\;\frac{x}{y} + t_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \left(\frac{2}{t} + t_1\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1e8 or 3.89999999999999968e91 < (/.f64 x y) Initial program 90.8%
Taylor expanded in z around 0 92.1%
if -1e8 < (/.f64 x y) < 3.89999999999999968e91Initial program 90.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
distribute-lft-out99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))))
(if (<= (/ x y) -5e+20)
(+ (/ x y) (* 2.0 (/ (/ 1.0 t) z)))
(if (<= (/ x y) 5e+89) (+ -2.0 (+ (/ 2.0 t) t_1)) (+ (/ x y) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double tmp;
if ((x / y) <= -5e+20) {
tmp = (x / y) + (2.0 * ((1.0 / t) / z));
} else if ((x / y) <= 5e+89) {
tmp = -2.0 + ((2.0 / t) + t_1);
} else {
tmp = (x / y) + 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 = 2.0d0 / (z * t)
if ((x / y) <= (-5d+20)) then
tmp = (x / y) + (2.0d0 * ((1.0d0 / t) / z))
else if ((x / y) <= 5d+89) then
tmp = (-2.0d0) + ((2.0d0 / t) + t_1)
else
tmp = (x / y) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double tmp;
if ((x / y) <= -5e+20) {
tmp = (x / y) + (2.0 * ((1.0 / t) / z));
} else if ((x / y) <= 5e+89) {
tmp = -2.0 + ((2.0 / t) + t_1);
} else {
tmp = (x / y) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) tmp = 0 if (x / y) <= -5e+20: tmp = (x / y) + (2.0 * ((1.0 / t) / z)) elif (x / y) <= 5e+89: tmp = -2.0 + ((2.0 / t) + t_1) else: tmp = (x / y) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) tmp = 0.0 if (Float64(x / y) <= -5e+20) tmp = Float64(Float64(x / y) + Float64(2.0 * Float64(Float64(1.0 / t) / z))); elseif (Float64(x / y) <= 5e+89) tmp = Float64(-2.0 + Float64(Float64(2.0 / t) + t_1)); else tmp = Float64(Float64(x / y) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); tmp = 0.0; if ((x / y) <= -5e+20) tmp = (x / y) + (2.0 * ((1.0 / t) / z)); elseif ((x / y) <= 5e+89) tmp = -2.0 + ((2.0 / t) + t_1); else tmp = (x / y) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+20], N[(N[(x / y), $MachinePrecision] + N[(2.0 * N[(N[(1.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e+89], N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{y} + 2 \cdot \frac{\frac{1}{t}}{z}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{+89}:\\
\;\;\;\;-2 + \left(\frac{2}{t} + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + t_1\\
\end{array}
\end{array}
if (/.f64 x y) < -5e20Initial program 93.3%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 90.3%
*-commutative90.3%
associate-/r*90.3%
Simplified90.3%
associate-/l/90.3%
associate-/r*90.3%
div-inv90.3%
*-un-lft-identity90.3%
times-frac90.3%
metadata-eval90.3%
Applied egg-rr90.3%
if -5e20 < (/.f64 x y) < 4.99999999999999983e89Initial program 90.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
distribute-lft-out99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
if 4.99999999999999983e89 < (/.f64 x y) Initial program 86.8%
Taylor expanded in z around 0 95.0%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ x y))))
(if (<= t -1.05e+154)
t_1
(if (<= t -6.5e-52)
(+ (/ x y) (/ 2.0 (* z t)))
(if (<= t 4.6e+19) (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (t <= -1.05e+154) {
tmp = t_1;
} else if (t <= -6.5e-52) {
tmp = (x / y) + (2.0 / (z * t));
} else if (t <= 4.6e+19) {
tmp = (2.0 + (2.0 / z)) * (1.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 = (-2.0d0) + (x / y)
if (t <= (-1.05d+154)) then
tmp = t_1
else if (t <= (-6.5d-52)) then
tmp = (x / y) + (2.0d0 / (z * t))
else if (t <= 4.6d+19) then
tmp = (2.0d0 + (2.0d0 / z)) * (1.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 = -2.0 + (x / y);
double tmp;
if (t <= -1.05e+154) {
tmp = t_1;
} else if (t <= -6.5e-52) {
tmp = (x / y) + (2.0 / (z * t));
} else if (t <= 4.6e+19) {
tmp = (2.0 + (2.0 / z)) * (1.0 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if t <= -1.05e+154: tmp = t_1 elif t <= -6.5e-52: tmp = (x / y) + (2.0 / (z * t)) elif t <= 4.6e+19: tmp = (2.0 + (2.0 / z)) * (1.0 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t <= -1.05e+154) tmp = t_1; elseif (t <= -6.5e-52) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); elseif (t <= 4.6e+19) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) * Float64(1.0 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (t <= -1.05e+154) tmp = t_1; elseif (t <= -6.5e-52) tmp = (x / y) + (2.0 / (z * t)); elseif (t <= 4.6e+19) tmp = (2.0 + (2.0 / z)) * (1.0 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+154], t$95$1, If[LessEqual[t, -6.5e-52], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+19], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+19}:\\
\;\;\;\;\left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.04999999999999997e154 or 4.6e19 < t Initial program 71.7%
Taylor expanded in t around inf 88.9%
if -1.04999999999999997e154 < t < -6.5e-52Initial program 97.4%
Taylor expanded in z around 0 79.8%
if -6.5e-52 < t < 4.6e19Initial program 99.8%
Taylor expanded in t around 0 86.4%
associate-*r/86.4%
metadata-eval86.4%
Simplified86.4%
div-inv86.4%
Applied egg-rr86.4%
Final simplification86.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ x y))))
(if (<= t -4.7e+153)
t_1
(if (<= t -1.2e-51)
(+ (/ x y) (/ (/ 2.0 z) t))
(if (<= t 6.8e+18) (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (t <= -4.7e+153) {
tmp = t_1;
} else if (t <= -1.2e-51) {
tmp = (x / y) + ((2.0 / z) / t);
} else if (t <= 6.8e+18) {
tmp = (2.0 + (2.0 / z)) * (1.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 = (-2.0d0) + (x / y)
if (t <= (-4.7d+153)) then
tmp = t_1
else if (t <= (-1.2d-51)) then
tmp = (x / y) + ((2.0d0 / z) / t)
else if (t <= 6.8d+18) then
tmp = (2.0d0 + (2.0d0 / z)) * (1.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 = -2.0 + (x / y);
double tmp;
if (t <= -4.7e+153) {
tmp = t_1;
} else if (t <= -1.2e-51) {
tmp = (x / y) + ((2.0 / z) / t);
} else if (t <= 6.8e+18) {
tmp = (2.0 + (2.0 / z)) * (1.0 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if t <= -4.7e+153: tmp = t_1 elif t <= -1.2e-51: tmp = (x / y) + ((2.0 / z) / t) elif t <= 6.8e+18: tmp = (2.0 + (2.0 / z)) * (1.0 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (t <= -4.7e+153) tmp = t_1; elseif (t <= -1.2e-51) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / z) / t)); elseif (t <= 6.8e+18) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) * Float64(1.0 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (t <= -4.7e+153) tmp = t_1; elseif (t <= -1.2e-51) tmp = (x / y) + ((2.0 / z) / t); elseif (t <= 6.8e+18) tmp = (2.0 + (2.0 / z)) * (1.0 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.7e+153], t$95$1, If[LessEqual[t, -1.2e-51], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+18], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;t \leq -4.7 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-51}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+18}:\\
\;\;\;\;\left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.69999999999999968e153 or 6.8e18 < t Initial program 71.7%
Taylor expanded in t around inf 88.9%
if -4.69999999999999968e153 < t < -1.2e-51Initial program 97.4%
Taylor expanded in t around 0 99.7%
associate--l+99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 79.8%
*-commutative79.8%
associate-/r*79.9%
Simplified79.9%
if -1.2e-51 < t < 6.8e18Initial program 99.8%
Taylor expanded in t around 0 86.4%
associate-*r/86.4%
metadata-eval86.4%
Simplified86.4%
div-inv86.4%
Applied egg-rr86.4%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.6e-7) (not (<= t 7.2e+18))) (+ -2.0 (/ x y)) (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.6e-7) || !(t <= 7.2e+18)) {
tmp = -2.0 + (x / y);
} else {
tmp = (2.0 + (2.0 / z)) * (1.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 <= (-6.6d-7)) .or. (.not. (t <= 7.2d+18))) then
tmp = (-2.0d0) + (x / y)
else
tmp = (2.0d0 + (2.0d0 / z)) * (1.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.6e-7) || !(t <= 7.2e+18)) {
tmp = -2.0 + (x / y);
} else {
tmp = (2.0 + (2.0 / z)) * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -6.6e-7) or not (t <= 7.2e+18): tmp = -2.0 + (x / y) else: tmp = (2.0 + (2.0 / z)) * (1.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -6.6e-7) || !(t <= 7.2e+18)) tmp = Float64(-2.0 + Float64(x / y)); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) * Float64(1.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -6.6e-7) || ~((t <= 7.2e+18))) tmp = -2.0 + (x / y); else tmp = (2.0 + (2.0 / z)) * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -6.6e-7], N[Not[LessEqual[t, 7.2e+18]], $MachinePrecision]], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{-7} \lor \neg \left(t \leq 7.2 \cdot 10^{+18}\right):\\
\;\;\;\;-2 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
\end{array}
\end{array}
if t < -6.6000000000000003e-7 or 7.2e18 < t Initial program 79.5%
Taylor expanded in t around inf 82.1%
if -6.6000000000000003e-7 < t < 7.2e18Initial program 99.8%
Taylor expanded in t around 0 85.8%
associate-*r/85.8%
metadata-eval85.8%
Simplified85.8%
div-inv85.8%
Applied egg-rr85.8%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1450000000000.0) (/ x y) (if (<= (/ x y) 4.2e+89) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1450000000000.0) {
tmp = x / y;
} else if ((x / y) <= 4.2e+89) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-1450000000000.0d0)) then
tmp = x / y
else if ((x / y) <= 4.2d+89) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1450000000000.0) {
tmp = x / y;
} else if ((x / y) <= 4.2e+89) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1450000000000.0: tmp = x / y elif (x / y) <= 4.2e+89: tmp = -2.0 + (2.0 / t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1450000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 4.2e+89) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -1450000000000.0) tmp = x / y; elseif ((x / y) <= 4.2e+89) tmp = -2.0 + (2.0 / t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1450000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.2e+89], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1450000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.2 \cdot 10^{+89}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.45e12 or 4.19999999999999972e89 < (/.f64 x y) Initial program 90.8%
Taylor expanded in x around inf 69.1%
if -1.45e12 < (/.f64 x y) < 4.19999999999999972e89Initial program 90.8%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
+-commutative99.9%
distribute-lft-out99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
distribute-lft-out99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in z around inf 56.5%
Final simplification61.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 t))))
(if (<= z -1.1e+125)
t_1
(if (<= z -1.1e-121)
(+ -2.0 (/ x y))
(if (<= z 3.7e-28) (/ 2.0 (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.1e+125) {
tmp = t_1;
} else if (z <= -1.1e-121) {
tmp = -2.0 + (x / y);
} else if (z <= 3.7e-28) {
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 = (-2.0d0) + (2.0d0 / t)
if (z <= (-1.1d+125)) then
tmp = t_1
else if (z <= (-1.1d-121)) then
tmp = (-2.0d0) + (x / y)
else if (z <= 3.7d-28) 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 = -2.0 + (2.0 / t);
double tmp;
if (z <= -1.1e+125) {
tmp = t_1;
} else if (z <= -1.1e-121) {
tmp = -2.0 + (x / y);
} else if (z <= 3.7e-28) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / t) tmp = 0 if z <= -1.1e+125: tmp = t_1 elif z <= -1.1e-121: tmp = -2.0 + (x / y) elif z <= 3.7e-28: tmp = 2.0 / (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / t)) tmp = 0.0 if (z <= -1.1e+125) tmp = t_1; elseif (z <= -1.1e-121) tmp = Float64(-2.0 + Float64(x / y)); elseif (z <= 3.7e-28) 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 = -2.0 + (2.0 / t); tmp = 0.0; if (z <= -1.1e+125) tmp = t_1; elseif (z <= -1.1e-121) tmp = -2.0 + (x / y); elseif (z <= 3.7e-28) tmp = 2.0 / (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+125], t$95$1, If[LessEqual[z, -1.1e-121], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-28], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{t}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-121}:\\
\;\;\;\;-2 + \frac{x}{y}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-28}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.09999999999999995e125 or 3.7000000000000002e-28 < z Initial program 78.6%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
distribute-lft-out100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 74.3%
sub-neg74.3%
associate-*r/74.3%
metadata-eval74.3%
associate-*r/74.3%
metadata-eval74.3%
metadata-eval74.3%
Simplified74.3%
Taylor expanded in z around inf 70.1%
if -1.09999999999999995e125 < z < -1.10000000000000011e-121Initial program 95.0%
Taylor expanded in t around inf 68.4%
if -1.10000000000000011e-121 < z < 3.7000000000000002e-28Initial program 99.8%
Taylor expanded in t around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
distribute-lft-out99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
distribute-lft-out99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 72.7%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.7e+25)
(+ (/ x y) (/ 2.0 t))
(if (<= z -2.25e-123)
(+ -2.0 (/ x y))
(if (<= z 4e-28) (/ 2.0 (* z t)) (+ -2.0 (/ 2.0 t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+25) {
tmp = (x / y) + (2.0 / t);
} else if (z <= -2.25e-123) {
tmp = -2.0 + (x / y);
} else if (z <= 4e-28) {
tmp = 2.0 / (z * t);
} 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 (z <= (-2.7d+25)) then
tmp = (x / y) + (2.0d0 / t)
else if (z <= (-2.25d-123)) then
tmp = (-2.0d0) + (x / y)
else if (z <= 4d-28) then
tmp = 2.0d0 / (z * t)
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 (z <= -2.7e+25) {
tmp = (x / y) + (2.0 / t);
} else if (z <= -2.25e-123) {
tmp = -2.0 + (x / y);
} else if (z <= 4e-28) {
tmp = 2.0 / (z * t);
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e+25: tmp = (x / y) + (2.0 / t) elif z <= -2.25e-123: tmp = -2.0 + (x / y) elif z <= 4e-28: tmp = 2.0 / (z * t) else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e+25) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (z <= -2.25e-123) tmp = Float64(-2.0 + Float64(x / y)); elseif (z <= 4e-28) tmp = Float64(2.0 / Float64(z * t)); 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 (z <= -2.7e+25) tmp = (x / y) + (2.0 / t); elseif (z <= -2.25e-123) tmp = -2.0 + (x / y); elseif (z <= 4e-28) tmp = 2.0 / (z * t); else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+25], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e-123], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-28], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-123}:\\
\;\;\;\;-2 + \frac{x}{y}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-28}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if z < -2.7e25Initial program 80.8%
Taylor expanded in z around inf 99.9%
associate-*r/99.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 82.3%
if -2.7e25 < z < -2.24999999999999997e-123Initial program 99.8%
Taylor expanded in t around inf 72.6%
if -2.24999999999999997e-123 < z < 3.99999999999999988e-28Initial program 99.8%
Taylor expanded in t around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
distribute-lft-out99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
distribute-lft-out99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 72.7%
if 3.99999999999999988e-28 < z Initial program 79.8%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
distribute-lft-out100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
distribute-lft-out100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified99.9%
Taylor expanded in x around 0 75.2%
sub-neg75.2%
associate-*r/75.2%
metadata-eval75.2%
associate-*r/75.2%
metadata-eval75.2%
metadata-eval75.2%
Simplified75.2%
Taylor expanded in z around inf 68.2%
Final simplification73.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -0.0029) (not (<= t 6.5e+18))) (+ -2.0 (/ x y)) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -0.0029) || !(t <= 6.5e+18)) {
tmp = -2.0 + (x / y);
} 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 <= (-0.0029d0)) .or. (.not. (t <= 6.5d+18))) then
tmp = (-2.0d0) + (x / y)
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 <= -0.0029) || !(t <= 6.5e+18)) {
tmp = -2.0 + (x / y);
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -0.0029) or not (t <= 6.5e+18): tmp = -2.0 + (x / y) else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -0.0029) || !(t <= 6.5e+18)) tmp = Float64(-2.0 + Float64(x / y)); 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 <= -0.0029) || ~((t <= 6.5e+18))) tmp = -2.0 + (x / y); else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -0.0029], N[Not[LessEqual[t, 6.5e+18]], $MachinePrecision]], N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0029 \lor \neg \left(t \leq 6.5 \cdot 10^{+18}\right):\\
\;\;\;\;-2 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -0.0029 or 6.5e18 < t Initial program 79.5%
Taylor expanded in t around inf 82.1%
if -0.0029 < t < 6.5e18Initial program 99.8%
Taylor expanded in t around 0 85.8%
associate-*r/85.8%
metadata-eval85.8%
Simplified85.8%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (<= t -0.46) -2.0 (if (<= t 3.4e+20) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -0.46) {
tmp = -2.0;
} else if (t <= 3.4e+20) {
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 <= (-0.46d0)) then
tmp = -2.0d0
else if (t <= 3.4d+20) 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 <= -0.46) {
tmp = -2.0;
} else if (t <= 3.4e+20) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -0.46: tmp = -2.0 elif t <= 3.4e+20: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -0.46) tmp = -2.0; elseif (t <= 3.4e+20) 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 <= -0.46) tmp = -2.0; elseif (t <= 3.4e+20) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -0.46], -2.0, If[LessEqual[t, 3.4e+20], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.46:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+20}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -0.46000000000000002 or 3.4e20 < t Initial program 79.4%
Taylor expanded in z around inf 81.9%
associate-*r/81.9%
associate-/l*81.9%
Simplified81.9%
Taylor expanded in x around 0 39.5%
div-sub39.5%
sub-neg39.5%
*-inverses39.5%
metadata-eval39.5%
Simplified39.5%
Taylor expanded in t around inf 39.5%
if -0.46000000000000002 < t < 3.4e20Initial program 99.8%
Taylor expanded in z around inf 52.0%
associate-*r/52.0%
associate-/l*52.0%
Simplified52.0%
Taylor expanded in t around 0 51.4%
Taylor expanded in x around 0 36.9%
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 90.8%
Taylor expanded in z around inf 65.1%
associate-*r/65.1%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in x around 0 38.4%
div-sub38.4%
sub-neg38.4%
*-inverses38.4%
metadata-eval38.4%
Simplified38.4%
Taylor expanded in t around inf 18.7%
Final simplification18.7%
(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 2023279
(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))))