
(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 (+ (/ 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 84.9%
+-commutative84.9%
remove-double-neg84.9%
distribute-frac-neg84.9%
unsub-neg84.9%
*-commutative84.9%
associate-*r*84.9%
distribute-rgt1-in84.9%
associate-/l*85.3%
fma-neg85.3%
*-commutative85.3%
fma-define85.3%
*-commutative85.3%
distribute-frac-neg85.3%
remove-double-neg85.3%
Simplified85.3%
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
(if (<= (/ x y) -5e+65)
(/ x y)
(if (<= (/ x y) 5e-6)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 4000.0) (/ (/ 2.0 z) t) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= 5e-6) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4000.0) {
tmp = (2.0 / z) / 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) <= (-5d+65)) then
tmp = x / y
else if ((x / y) <= 5d-6) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 4000.0d0) then
tmp = (2.0d0 / z) / 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) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= 5e-6) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4000.0) {
tmp = (2.0 / z) / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+65: tmp = x / y elif (x / y) <= 5e-6: tmp = -2.0 + (2.0 / t) elif (x / y) <= 4000.0: tmp = (2.0 / z) / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+65) tmp = Float64(x / y); elseif (Float64(x / y) <= 5e-6) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 4000.0) tmp = Float64(Float64(2.0 / z) / t); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+65) tmp = x / y; elseif ((x / y) <= 5e-6) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 4000.0) tmp = (2.0 / z) / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+65], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-6], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4000.0], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+65}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 4000:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999973e65 or 4e3 < (/.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 74.4%
if -4.99999999999999973e65 < (/.f64 x y) < 5.00000000000000041e-6Initial program 85.3%
+-commutative85.3%
remove-double-neg85.3%
distribute-frac-neg85.3%
unsub-neg85.3%
*-commutative85.3%
associate-*r*85.3%
distribute-rgt1-in85.3%
associate-/l*85.3%
fma-neg85.3%
*-commutative85.3%
fma-define85.3%
*-commutative85.3%
distribute-frac-neg85.3%
remove-double-neg85.3%
Simplified85.3%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 96.1%
sub-neg96.1%
metadata-eval96.1%
associate-*r/96.1%
metadata-eval96.1%
associate-/l/96.2%
*-rgt-identity96.2%
associate-*r/96.1%
distribute-rgt-in96.1%
associate-*l/96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 59.9%
sub-neg59.9%
associate-*r/59.9%
metadata-eval59.9%
metadata-eval59.9%
+-commutative59.9%
Simplified59.9%
if 5.00000000000000041e-6 < (/.f64 x y) < 4e3Initial program 99.7%
Taylor expanded in z around 0 99.7%
associate-/l/100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -5e+65)
(/ x y)
(if (<= (/ x y) 5e-6)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 4000.0) (/ 2.0 (* z t)) (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= 5e-6) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4000.0) {
tmp = 2.0 / (z * 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) <= (-5d+65)) then
tmp = x / y
else if ((x / y) <= 5d-6) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 4000.0d0) then
tmp = 2.0d0 / (z * 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) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= 5e-6) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 4000.0) {
tmp = 2.0 / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+65: tmp = x / y elif (x / y) <= 5e-6: tmp = -2.0 + (2.0 / t) elif (x / y) <= 4000.0: tmp = 2.0 / (z * t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+65) tmp = Float64(x / y); elseif (Float64(x / y) <= 5e-6) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 4000.0) tmp = Float64(2.0 / Float64(z * t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+65) tmp = x / y; elseif ((x / y) <= 5e-6) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 4000.0) tmp = 2.0 / (z * t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+65], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-6], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4000.0], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+65}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 4000:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999973e65 or 4e3 < (/.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 74.4%
if -4.99999999999999973e65 < (/.f64 x y) < 5.00000000000000041e-6Initial program 85.3%
+-commutative85.3%
remove-double-neg85.3%
distribute-frac-neg85.3%
unsub-neg85.3%
*-commutative85.3%
associate-*r*85.3%
distribute-rgt1-in85.3%
associate-/l*85.3%
fma-neg85.3%
*-commutative85.3%
fma-define85.3%
*-commutative85.3%
distribute-frac-neg85.3%
remove-double-neg85.3%
Simplified85.3%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 96.1%
sub-neg96.1%
metadata-eval96.1%
associate-*r/96.1%
metadata-eval96.1%
associate-/l/96.2%
*-rgt-identity96.2%
associate-*r/96.1%
distribute-rgt-in96.1%
associate-*l/96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 59.9%
sub-neg59.9%
associate-*r/59.9%
metadata-eval59.9%
metadata-eval59.9%
+-commutative59.9%
Simplified59.9%
if 5.00000000000000041e-6 < (/.f64 x y) < 4e3Initial program 99.7%
Taylor expanded in z around 0 99.7%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+65) (/ x y) (if (<= (/ x y) -5e-92) (/ 2.0 t) (if (<= (/ x y) 0.02) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= -5e-92) {
tmp = 2.0 / t;
} else if ((x / y) <= 0.02) {
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) <= (-5d+65)) then
tmp = x / y
else if ((x / y) <= (-5d-92)) then
tmp = 2.0d0 / t
else if ((x / y) <= 0.02d0) 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) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= -5e-92) {
tmp = 2.0 / t;
} else if ((x / y) <= 0.02) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+65: tmp = x / y elif (x / y) <= -5e-92: tmp = 2.0 / t elif (x / y) <= 0.02: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+65) tmp = Float64(x / y); elseif (Float64(x / y) <= -5e-92) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 0.02) 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) <= -5e+65) tmp = x / y; elseif ((x / y) <= -5e-92) tmp = 2.0 / t; elseif ((x / y) <= 0.02) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+65], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -5e-92], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.02], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+65}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-92}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.02:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999973e65 or 0.0200000000000000004 < (/.f64 x y) Initial program 84.0%
Taylor expanded in x around inf 72.4%
if -4.99999999999999973e65 < (/.f64 x y) < -5.00000000000000011e-92Initial program 90.3%
Taylor expanded in t around 0 78.0%
associate-*r/78.0%
metadata-eval78.0%
Simplified78.0%
Taylor expanded in z around inf 38.7%
if -5.00000000000000011e-92 < (/.f64 x y) < 0.0200000000000000004Initial program 84.3%
Taylor expanded in t around inf 38.1%
Taylor expanded in x around 0 37.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+119) (not (<= (/ x y) 4000.0))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+119) || !((x / y) <= 4000.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1d+119)) .or. (.not. ((x / y) <= 4000.0d0))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+119) || !((x / y) <= 4000.0)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+119) or not ((x / y) <= 4000.0): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+119) || !(Float64(x / y) <= 4000.0)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+119) || ~(((x / y) <= 4000.0))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+119], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+119} \lor \neg \left(\frac{x}{y} \leq 4000\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999944e118 or 4e3 < (/.f64 x y) Initial program 83.4%
Taylor expanded in z around inf 88.0%
div-sub88.0%
sub-neg88.0%
*-inverses88.0%
metadata-eval88.0%
distribute-lft-in88.0%
associate-*r/88.0%
metadata-eval88.0%
metadata-eval88.0%
Simplified88.0%
if -9.99999999999999944e118 < (/.f64 x y) < 4e3Initial program 85.9%
+-commutative85.9%
remove-double-neg85.9%
distribute-frac-neg85.9%
unsub-neg85.9%
*-commutative85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
associate-/l*85.9%
fma-neg85.9%
*-commutative85.9%
fma-define85.9%
*-commutative85.9%
distribute-frac-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 94.7%
sub-neg94.7%
metadata-eval94.7%
associate-*r/94.7%
metadata-eval94.7%
associate-/l/94.7%
*-rgt-identity94.7%
associate-*r/94.6%
distribute-rgt-in94.7%
associate-*l/94.7%
*-lft-identity94.7%
+-commutative94.7%
Simplified94.7%
Final simplification92.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+119) (not (<= (/ x y) 4000.0))) (/ x y) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+119) || !((x / y) <= 4000.0)) {
tmp = x / y;
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-1d+119)) .or. (.not. ((x / y) <= 4000.0d0))) then
tmp = x / y
else
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+119) || !((x / y) <= 4000.0)) {
tmp = x / y;
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+119) or not ((x / y) <= 4000.0): tmp = x / y else: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+119) || !(Float64(x / y) <= 4000.0)) tmp = Float64(x / y); else tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e+119) || ~(((x / y) <= 4000.0))) tmp = x / y; else tmp = ((2.0 + (2.0 / z)) / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+119], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+119} \lor \neg \left(\frac{x}{y} \leq 4000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999944e118 or 4e3 < (/.f64 x y) Initial program 83.4%
Taylor expanded in x around inf 76.5%
if -9.99999999999999944e118 < (/.f64 x y) < 4e3Initial program 85.9%
+-commutative85.9%
remove-double-neg85.9%
distribute-frac-neg85.9%
unsub-neg85.9%
*-commutative85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
associate-/l*85.9%
fma-neg85.9%
*-commutative85.9%
fma-define85.9%
*-commutative85.9%
distribute-frac-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 94.7%
sub-neg94.7%
metadata-eval94.7%
associate-*r/94.7%
metadata-eval94.7%
associate-/l/94.7%
*-rgt-identity94.7%
associate-*r/94.6%
distribute-rgt-in94.7%
associate-*l/94.7%
*-lft-identity94.7%
+-commutative94.7%
Simplified94.7%
Final simplification87.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -10600000000.0)
t_1
(if (<= t -3.8e-210)
(/ (/ 2.0 z) t)
(if (<= t 8.5e-6) (* 2.0 (/ z (* z t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -10600000000.0) {
tmp = t_1;
} else if (t <= -3.8e-210) {
tmp = (2.0 / z) / t;
} else if (t <= 8.5e-6) {
tmp = 2.0 * (z / (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 (t <= (-10600000000.0d0)) then
tmp = t_1
else if (t <= (-3.8d-210)) then
tmp = (2.0d0 / z) / t
else if (t <= 8.5d-6) then
tmp = 2.0d0 * (z / (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 (t <= -10600000000.0) {
tmp = t_1;
} else if (t <= -3.8e-210) {
tmp = (2.0 / z) / t;
} else if (t <= 8.5e-6) {
tmp = 2.0 * (z / (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -10600000000.0: tmp = t_1 elif t <= -3.8e-210: tmp = (2.0 / z) / t elif t <= 8.5e-6: tmp = 2.0 * (z / (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 (t <= -10600000000.0) tmp = t_1; elseif (t <= -3.8e-210) tmp = Float64(Float64(2.0 / z) / t); elseif (t <= 8.5e-6) tmp = Float64(2.0 * Float64(z / 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 (t <= -10600000000.0) tmp = t_1; elseif (t <= -3.8e-210) tmp = (2.0 / z) / t; elseif (t <= 8.5e-6) tmp = 2.0 * (z / (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[t, -10600000000.0], t$95$1, If[LessEqual[t, -3.8e-210], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 8.5e-6], N[(2.0 * N[(z / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -10600000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-210}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-6}:\\
\;\;\;\;2 \cdot \frac{z}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.06e10 or 8.4999999999999999e-6 < t Initial program 68.6%
Taylor expanded in t around inf 82.9%
if -1.06e10 < t < -3.80000000000000003e-210Initial program 97.5%
Taylor expanded in z around 0 45.9%
associate-/l/46.0%
Simplified46.0%
if -3.80000000000000003e-210 < t < 8.4999999999999999e-6Initial 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 0 87.3%
Taylor expanded in z around inf 60.0%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -240000.0) (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 <= -240000.0) || !(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 <= (-240000.0d0)) .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 <= -240000.0) || !(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 <= -240000.0) 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 <= -240000.0) || !(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 <= -240000.0) || ~((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, -240000.0], 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 -240000 \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 < -2.4e5 or 1 < z Initial program 72.7%
Taylor expanded in z around inf 99.7%
div-sub99.7%
sub-neg99.7%
*-inverses99.7%
metadata-eval99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
if -2.4e5 < z < 1Initial program 98.1%
+-commutative98.1%
remove-double-neg98.1%
distribute-frac-neg98.1%
unsub-neg98.1%
*-commutative98.1%
associate-*r*98.1%
distribute-rgt1-in98.1%
associate-/l*98.1%
fma-neg98.1%
*-commutative98.1%
fma-define98.1%
*-commutative98.1%
distribute-frac-neg98.1%
remove-double-neg98.1%
Simplified98.1%
Taylor expanded in t around inf 99.1%
sub-neg99.1%
+-commutative99.1%
metadata-eval99.1%
associate-+l+99.1%
associate-*r/99.1%
distribute-lft-in99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around 0 97.6%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+119) (not (<= (/ x y) 4000.0))) (/ x y) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+119) || !((x / y) <= 4000.0)) {
tmp = 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 (((x / y) <= (-1d+119)) .or. (.not. ((x / y) <= 4000.0d0))) then
tmp = 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 (((x / y) <= -1e+119) || !((x / y) <= 4000.0)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+119) or not ((x / y) <= 4000.0): tmp = x / y else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e+119) || !(Float64(x / y) <= 4000.0)) tmp = Float64(x / y); 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 (((x / y) <= -1e+119) || ~(((x / y) <= 4000.0))) tmp = x / y; else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e+119], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+119} \lor \neg \left(\frac{x}{y} \leq 4000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999944e118 or 4e3 < (/.f64 x y) Initial program 83.4%
Taylor expanded in x around inf 76.5%
if -9.99999999999999944e118 < (/.f64 x y) < 4e3Initial program 85.9%
+-commutative85.9%
remove-double-neg85.9%
distribute-frac-neg85.9%
unsub-neg85.9%
*-commutative85.9%
associate-*r*85.9%
distribute-rgt1-in85.9%
associate-/l*85.9%
fma-neg85.9%
*-commutative85.9%
fma-define85.9%
*-commutative85.9%
distribute-frac-neg85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in t around inf 99.9%
sub-neg99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 94.7%
sub-neg94.7%
metadata-eval94.7%
associate-*r/94.7%
metadata-eval94.7%
associate-/l/94.7%
*-rgt-identity94.7%
associate-*r/94.6%
distribute-rgt-in94.7%
associate-*l/94.7%
*-lft-identity94.7%
+-commutative94.7%
Simplified94.7%
Taylor expanded in z around 0 67.6%
Final simplification71.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -5e+65) (not (<= (/ x y) 0.02))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -5e+65) || !((x / y) <= 0.02)) {
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) <= (-5d+65)) .or. (.not. ((x / y) <= 0.02d0))) 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) <= -5e+65) || !((x / y) <= 0.02)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -5e+65) or not ((x / y) <= 0.02): 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) <= -5e+65) || !(Float64(x / y) <= 0.02)) 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) <= -5e+65) || ~(((x / y) <= 0.02))) 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], -5e+65], N[Not[LessEqual[N[(x / y), $MachinePrecision], 0.02]], $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 -5 \cdot 10^{+65} \lor \neg \left(\frac{x}{y} \leq 0.02\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999973e65 or 0.0200000000000000004 < (/.f64 x y) Initial program 84.0%
Taylor expanded in x around inf 72.4%
if -4.99999999999999973e65 < (/.f64 x y) < 0.0200000000000000004Initial program 85.6%
+-commutative85.6%
remove-double-neg85.6%
distribute-frac-neg85.6%
unsub-neg85.6%
*-commutative85.6%
associate-*r*85.6%
distribute-rgt1-in85.6%
associate-/l*85.6%
fma-neg85.6%
*-commutative85.6%
fma-define85.6%
*-commutative85.6%
distribute-frac-neg85.6%
remove-double-neg85.6%
Simplified85.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 x around 0 96.2%
sub-neg96.2%
metadata-eval96.2%
associate-*r/96.2%
metadata-eval96.2%
associate-/l/96.3%
*-rgt-identity96.3%
associate-*r/96.2%
distribute-rgt-in96.2%
associate-*l/96.3%
*-lft-identity96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in z around inf 58.7%
sub-neg58.7%
associate-*r/58.7%
metadata-eval58.7%
metadata-eval58.7%
+-commutative58.7%
Simplified58.7%
Final simplification64.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+65) (/ x y) (if (<= (/ x y) 2e-37) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= 2e-37) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-5d+65)) then
tmp = x / y
else if ((x / y) <= 2d-37) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+65) {
tmp = x / y;
} else if ((x / y) <= 2e-37) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+65: tmp = x / y elif (x / y) <= 2e-37: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+65) tmp = Float64(x / y); elseif (Float64(x / y) <= 2e-37) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5e+65) tmp = x / y; elseif ((x / y) <= 2e-37) tmp = -2.0 + (2.0 / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+65], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-37], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+65}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-37}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.99999999999999973e65Initial program 90.1%
Taylor expanded in x around inf 80.9%
if -4.99999999999999973e65 < (/.f64 x y) < 2.00000000000000013e-37Initial program 87.6%
+-commutative87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
unsub-neg87.6%
*-commutative87.6%
associate-*r*87.6%
distribute-rgt1-in87.6%
associate-/l*87.6%
fma-neg87.6%
*-commutative87.6%
fma-define87.6%
*-commutative87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
Simplified87.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 x around 0 96.7%
sub-neg96.7%
metadata-eval96.7%
associate-*r/96.7%
metadata-eval96.7%
associate-/l/96.7%
*-rgt-identity96.7%
associate-*r/96.6%
distribute-rgt-in96.6%
associate-*l/96.7%
*-lft-identity96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in z around inf 59.1%
sub-neg59.1%
associate-*r/59.1%
metadata-eval59.1%
metadata-eval59.1%
+-commutative59.1%
Simplified59.1%
if 2.00000000000000013e-37 < (/.f64 x y) Initial program 74.9%
Taylor expanded in t around inf 64.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -180000000000.0) (not (<= t 0.122))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -180000000000.0) || !(t <= 0.122)) {
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 <= (-180000000000.0d0)) .or. (.not. (t <= 0.122d0))) 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 <= -180000000000.0) || !(t <= 0.122)) {
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 <= -180000000000.0) or not (t <= 0.122): 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 <= -180000000000.0) || !(t <= 0.122)) 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 <= -180000000000.0) || ~((t <= 0.122))) 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, -180000000000.0], N[Not[LessEqual[t, 0.122]], $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 -180000000000 \lor \neg \left(t \leq 0.122\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.8e11 or 0.122 < t Initial program 68.6%
Taylor expanded in t around inf 82.9%
if -1.8e11 < t < 0.122Initial program 98.9%
Taylor expanded in t around 0 80.7%
associate-*r/80.7%
metadata-eval80.7%
Simplified80.7%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.16e-11) -2.0 (if (<= t 0.95) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.16e-11) {
tmp = -2.0;
} else if (t <= 0.95) {
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.16d-11)) then
tmp = -2.0d0
else if (t <= 0.95d0) 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.16e-11) {
tmp = -2.0;
} else if (t <= 0.95) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.16e-11: tmp = -2.0 elif t <= 0.95: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.16e-11) tmp = -2.0; elseif (t <= 0.95) 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.16e-11) tmp = -2.0; elseif (t <= 0.95) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.16e-11], -2.0, If[LessEqual[t, 0.95], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{-11}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 0.95:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.1600000000000001e-11 or 0.94999999999999996 < t Initial program 70.0%
Taylor expanded in t around inf 80.6%
Taylor expanded in x around 0 37.1%
if -1.1600000000000001e-11 < t < 0.94999999999999996Initial program 98.9%
Taylor expanded in t around 0 81.3%
associate-*r/81.3%
metadata-eval81.3%
Simplified81.3%
Taylor expanded in z around inf 41.7%
(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 84.9%
Taylor expanded in t around inf 50.4%
Taylor expanded in x around 0 19.4%
(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 2024144
(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))))