
(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 (/ x y)) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
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) + (x / y)) + ((2.0d0 + (2.0d0 / z)) / t)
end function
public static double code(double x, double y, double z, double t) {
return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t);
}
def code(x, y, z, t): return (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t)
function code(x, y, z, t) return Float64(Float64(-2.0 + Float64(x / y)) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)) end
function tmp = code(x, y, z, t) tmp = (-2.0 + (x / y)) + ((2.0 + (2.0 / z)) / t); end
code[x_, y_, z_, t_] := N[(N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-2 + \frac{x}{y}\right) + \frac{2 + \frac{2}{z}}{t}
\end{array}
Initial program 85.8%
+-commutative85.8%
remove-double-neg85.8%
distribute-frac-neg85.8%
unsub-neg85.8%
*-commutative85.8%
associate-*r*85.8%
distribute-rgt1-in85.8%
associate-/l*85.8%
fma-neg85.8%
*-commutative85.8%
fma-define85.8%
*-commutative85.8%
distribute-frac-neg85.8%
remove-double-neg85.8%
Simplified85.8%
Taylor expanded in t around inf 99.5%
associate--l+99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
associate-*r/99.5%
distribute-lft-in99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -8.0) (not (<= (/ x y) 4.1e+80))) (+ (/ x y) (/ (/ 2.0 t) z)) (+ (/ 2.0 (* z t)) (+ -2.0 (/ 2.0 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -8.0) || !((x / y) <= 4.1e+80)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = (2.0 / (z * t)) + (-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) <= (-8.0d0)) .or. (.not. ((x / y) <= 4.1d+80))) then
tmp = (x / y) + ((2.0d0 / t) / z)
else
tmp = (2.0d0 / (z * t)) + ((-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) <= -8.0) || !((x / y) <= 4.1e+80)) {
tmp = (x / y) + ((2.0 / t) / z);
} else {
tmp = (2.0 / (z * t)) + (-2.0 + (2.0 / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -8.0) or not ((x / y) <= 4.1e+80): tmp = (x / y) + ((2.0 / t) / z) else: tmp = (2.0 / (z * t)) + (-2.0 + (2.0 / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -8.0) || !(Float64(x / y) <= 4.1e+80)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); else tmp = Float64(Float64(2.0 / Float64(z * t)) + 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) <= -8.0) || ~(((x / y) <= 4.1e+80))) tmp = (x / y) + ((2.0 / t) / z); else tmp = (2.0 / (z * t)) + (-2.0 + (2.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -8.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.1e+80]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -8 \lor \neg \left(\frac{x}{y} \leq 4.1 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t} + \left(-2 + \frac{2}{t}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -8 or 4.10000000000000001e80 < (/.f64 x y) Initial program 84.5%
Taylor expanded in z around 0 89.3%
associate-/r*89.3%
Simplified89.3%
if -8 < (/.f64 x y) < 4.10000000000000001e80Initial program 86.9%
+-commutative86.9%
remove-double-neg86.9%
distribute-frac-neg86.9%
unsub-neg86.9%
*-commutative86.9%
associate-*r*86.9%
distribute-rgt1-in86.9%
associate-/l*86.9%
fma-neg86.9%
*-commutative86.9%
fma-define86.9%
*-commutative86.9%
distribute-frac-neg86.9%
remove-double-neg86.9%
Simplified86.9%
Taylor expanded in t around inf 99.9%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.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 97.5%
associate--l+97.5%
associate-*r/97.5%
metadata-eval97.5%
sub-neg97.5%
metadata-eval97.5%
associate-+l+97.5%
+-commutative97.5%
associate-+l+97.5%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.1e+62) (/ x y) (if (<= (/ x y) 1.85e+70) (+ -2.0 (/ 2.0 (* z t))) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.1e+62) {
tmp = x / y;
} else if ((x / y) <= 1.85e+70) {
tmp = -2.0 + (2.0 / (z * 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) <= (-1.1d+62)) then
tmp = x / y
else if ((x / y) <= 1.85d+70) then
tmp = (-2.0d0) + (2.0d0 / (z * 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) <= -1.1e+62) {
tmp = x / y;
} else if ((x / y) <= 1.85e+70) {
tmp = -2.0 + (2.0 / (z * t));
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.1e+62: tmp = x / y elif (x / y) <= 1.85e+70: tmp = -2.0 + (2.0 / (z * t)) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1.1e+62) tmp = Float64(x / y); elseif (Float64(x / y) <= 1.85e+70) tmp = Float64(-2.0 + Float64(2.0 / Float64(z * 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) <= -1.1e+62) tmp = x / y; elseif ((x / y) <= 1.85e+70) tmp = -2.0 + (2.0 / (z * t)); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1.1e+62], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.85e+70], N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.1 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.85 \cdot 10^{+70}:\\
\;\;\;\;-2 + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.10000000000000007e62Initial program 84.8%
Taylor expanded in x around inf 75.0%
if -1.10000000000000007e62 < (/.f64 x y) < 1.84999999999999994e70Initial program 86.0%
+-commutative86.0%
remove-double-neg86.0%
distribute-frac-neg86.0%
unsub-neg86.0%
*-commutative86.0%
associate-*r*86.0%
distribute-rgt1-in86.0%
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%
associate--l+99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.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 93.3%
associate--l+93.3%
associate-*r/93.3%
metadata-eval93.3%
sub-neg93.3%
metadata-eval93.3%
associate-+l+93.3%
+-commutative93.3%
associate-+l+93.3%
associate-*r/93.3%
metadata-eval93.3%
Simplified93.3%
Taylor expanded in t around inf 74.2%
if 1.84999999999999994e70 < (/.f64 x y) Initial program 86.3%
Taylor expanded in t around inf 84.2%
Final simplification76.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.25) (not (<= (/ x y) 4.4e+80))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.25) || !((x / y) <= 4.4e+80)) {
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) <= (-0.25d0)) .or. (.not. ((x / y) <= 4.4d+80))) 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) <= -0.25) || !((x / y) <= 4.4e+80)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.25) or not ((x / y) <= 4.4e+80): 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) <= -0.25) || !(Float64(x / y) <= 4.4e+80)) 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) <= -0.25) || ~(((x / y) <= 4.4e+80))) 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], -0.25], N[Not[LessEqual[N[(x / y), $MachinePrecision], 4.4e+80]], $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 -0.25 \lor \neg \left(\frac{x}{y} \leq 4.4 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.25 or 4.40000000000000005e80 < (/.f64 x y) Initial program 84.6%
Taylor expanded in x around inf 72.0%
if -0.25 < (/.f64 x y) < 4.40000000000000005e80Initial program 86.8%
Taylor expanded in z around inf 61.6%
div-sub61.6%
sub-neg61.6%
*-inverses61.6%
metadata-eval61.6%
distribute-lft-in61.6%
associate-*r/61.6%
metadata-eval61.6%
metadata-eval61.6%
Simplified61.6%
Taylor expanded in x around 0 59.2%
sub-neg59.2%
associate-*r/59.2%
metadata-eval59.2%
metadata-eval59.2%
Simplified59.2%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4300000000.0) (not (<= t 3.7e+26))) (- (/ x y) 2.0) (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4300000000.0) || !(t <= 3.7e+26)) {
tmp = (x / y) - 2.0;
} 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 <= (-4300000000.0d0)) .or. (.not. (t <= 3.7d+26))) then
tmp = (x / y) - 2.0d0
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 <= -4300000000.0) || !(t <= 3.7e+26)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) * (1.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4300000000.0) or not (t <= 3.7e+26): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) * (1.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4300000000.0) || !(t <= 3.7e+26)) tmp = Float64(Float64(x / y) - 2.0); 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 <= -4300000000.0) || ~((t <= 3.7e+26))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) * (1.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4300000000.0], N[Not[LessEqual[t, 3.7e+26]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $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 -4300000000 \lor \neg \left(t \leq 3.7 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
\end{array}
\end{array}
if t < -4.3e9 or 3.69999999999999988e26 < t Initial program 71.0%
Taylor expanded in t around inf 88.5%
if -4.3e9 < t < 3.69999999999999988e26Initial program 99.1%
Taylor expanded in t around 0 76.0%
associate-*r/76.0%
metadata-eval76.0%
Simplified76.0%
div-inv76.0%
Applied egg-rr76.0%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.9) (not (<= t 3.7e+26))) (- (/ x y) 2.0) (+ (/ 2.0 t) (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.9) || !(t <= 3.7e+26)) {
tmp = (x / y) - 2.0;
} else {
tmp = (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 ((t <= (-7.9d0)) .or. (.not. (t <= 3.7d+26))) then
tmp = (x / y) - 2.0d0
else
tmp = (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 ((t <= -7.9) || !(t <= 3.7e+26)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.9) or not (t <= 3.7e+26): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.9) || !(t <= 3.7e+26)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7.9) || ~((t <= 3.7e+26))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.9], N[Not[LessEqual[t, 3.7e+26]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.9 \lor \neg \left(t \leq 3.7 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if t < -7.9000000000000004 or 3.69999999999999988e26 < t Initial program 71.0%
Taylor expanded in t around inf 88.5%
if -7.9000000000000004 < t < 3.69999999999999988e26Initial program 99.1%
Taylor expanded in t around 0 76.0%
associate-*r/76.0%
metadata-eval76.0%
Simplified76.0%
Taylor expanded in z around inf 76.1%
associate-*r/76.1%
metadata-eval76.1%
+-commutative76.1%
associate-*r/76.1%
metadata-eval76.1%
Simplified76.1%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2e-23) (not (<= z 1.95e-43))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ -2.0 (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e-23) || !(z <= 1.95e-43)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + (2.0 / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2d-23)) .or. (.not. (z <= 1.95d-43))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (-2.0d0) + (2.0d0 / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e-23) || !(z <= 1.95e-43)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = -2.0 + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2e-23) or not (z <= 1.95e-43): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = -2.0 + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2e-23) || !(z <= 1.95e-43)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(-2.0 + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2e-23) || ~((z <= 1.95e-43))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = -2.0 + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2e-23], N[Not[LessEqual[z, 1.95e-43]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-23} \lor \neg \left(z \leq 1.95 \cdot 10^{-43}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.99999999999999992e-23 or 1.95e-43 < z Initial program 72.9%
Taylor expanded in z around inf 98.0%
div-sub98.0%
sub-neg98.0%
*-inverses98.0%
metadata-eval98.0%
distribute-lft-in98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
if -1.99999999999999992e-23 < z < 1.95e-43Initial program 99.1%
+-commutative99.1%
remove-double-neg99.1%
distribute-frac-neg99.1%
unsub-neg99.1%
*-commutative99.1%
associate-*r*99.1%
distribute-rgt1-in99.1%
associate-/l*99.1%
fma-neg99.1%
*-commutative99.1%
fma-define99.1%
*-commutative99.1%
distribute-frac-neg99.1%
remove-double-neg99.1%
Simplified99.1%
Taylor expanded in t around inf 99.0%
associate--l+99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
associate-*r/99.0%
distribute-lft-in99.0%
metadata-eval99.0%
associate-*r/99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around 0 74.9%
associate--l+74.9%
associate-*r/74.9%
metadata-eval74.9%
sub-neg74.9%
metadata-eval74.9%
associate-+l+74.9%
+-commutative74.9%
associate-+l+74.9%
associate-*r/74.9%
metadata-eval74.9%
Simplified74.9%
Taylor expanded in t around inf 74.9%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.5e-25) (not (<= z 6.6e-41))) (+ (/ 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 <= -2.5e-25) || !(z <= 6.6e-41)) {
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 <= (-2.5d-25)) .or. (.not. (z <= 6.6d-41))) 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 <= -2.5e-25) || !(z <= 6.6e-41)) {
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 <= -2.5e-25) or not (z <= 6.6e-41): 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 <= -2.5e-25) || !(z <= 6.6e-41)) 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 <= -2.5e-25) || ~((z <= 6.6e-41))) 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, -2.5e-25], N[Not[LessEqual[z, 6.6e-41]], $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 -2.5 \cdot 10^{-25} \lor \neg \left(z \leq 6.6 \cdot 10^{-41}\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 < -2.49999999999999981e-25 or 6.60000000000000047e-41 < z Initial program 73.1%
Taylor expanded in z around inf 98.0%
div-sub98.0%
sub-neg98.0%
*-inverses98.0%
metadata-eval98.0%
distribute-lft-in98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
Simplified98.0%
if -2.49999999999999981e-25 < z < 6.60000000000000047e-41Initial program 99.1%
Taylor expanded in z around 0 86.7%
associate-/r*86.7%
Simplified86.7%
Final simplification92.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.65e-15) (- (/ x y) 2.0) (if (<= (/ x y) 4.1e+80) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1.65e-15) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 4.1e+80) {
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) <= (-1.65d-15)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= 4.1d+80) 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) <= -1.65e-15) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= 4.1e+80) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1.65e-15: tmp = (x / y) - 2.0 elif (x / y) <= 4.1e+80: 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) <= -1.65e-15) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= 4.1e+80) 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) <= -1.65e-15) tmp = (x / y) - 2.0; elseif ((x / y) <= 4.1e+80) 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], -1.65e-15], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 4.1e+80], 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 -1.65 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq 4.1 \cdot 10^{+80}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.65e-15Initial program 84.0%
Taylor expanded in t around inf 64.2%
if -1.65e-15 < (/.f64 x y) < 4.10000000000000001e80Initial program 86.7%
Taylor expanded in z around inf 61.4%
div-sub61.4%
sub-neg61.4%
*-inverses61.4%
metadata-eval61.4%
distribute-lft-in61.4%
associate-*r/61.4%
metadata-eval61.4%
metadata-eval61.4%
Simplified61.4%
Taylor expanded in x around 0 59.4%
sub-neg59.4%
associate-*r/59.4%
metadata-eval59.4%
metadata-eval59.4%
Simplified59.4%
if 4.10000000000000001e80 < (/.f64 x y) Initial program 85.7%
Taylor expanded in x around inf 85.5%
Final simplification65.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -0.25) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -0.25) || !((x / y) <= 2.0)) {
tmp = x / y;
} 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 (((x / y) <= (-0.25d0)) .or. (.not. ((x / y) <= 2.0d0))) then
tmp = x / y
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 (((x / y) <= -0.25) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -0.25) or not ((x / y) <= 2.0): tmp = x / y else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -0.25) || !(Float64(x / y) <= 2.0)) tmp = Float64(x / y); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -0.25) || ~(((x / y) <= 2.0))) tmp = x / y; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -0.25], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.25 \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -0.25 or 2 < (/.f64 x y) Initial program 85.7%
Taylor expanded in x around inf 68.5%
if -0.25 < (/.f64 x y) < 2Initial program 85.9%
Taylor expanded in z around inf 60.7%
div-sub60.7%
sub-neg60.7%
*-inverses60.7%
metadata-eval60.7%
distribute-lft-in60.7%
associate-*r/60.7%
metadata-eval60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in x around 0 59.6%
sub-neg59.6%
associate-*r/59.6%
metadata-eval59.6%
metadata-eval59.6%
Simplified59.6%
Taylor expanded in t around inf 41.8%
Final simplification55.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -720.0) (not (<= t 3.7e+26))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -720.0) || !(t <= 3.7e+26)) {
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 <= (-720.0d0)) .or. (.not. (t <= 3.7d+26))) 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 <= -720.0) || !(t <= 3.7e+26)) {
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 <= -720.0) or not (t <= 3.7e+26): 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 <= -720.0) || !(t <= 3.7e+26)) 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 <= -720.0) || ~((t <= 3.7e+26))) 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, -720.0], N[Not[LessEqual[t, 3.7e+26]], $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 -720 \lor \neg \left(t \leq 3.7 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -720 or 3.69999999999999988e26 < t Initial program 71.0%
Taylor expanded in t around inf 88.5%
if -720 < t < 3.69999999999999988e26Initial program 99.1%
Taylor expanded in t around 0 76.0%
associate-*r/76.0%
metadata-eval76.0%
Simplified76.0%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.85e-31) (not (<= t 1.1e-69))) (- (/ x y) 2.0) (/ 2.0 (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.85e-31) || !(t <= 1.1e-69)) {
tmp = (x / y) - 2.0;
} else {
tmp = 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 <= (-1.85d-31)) .or. (.not. (t <= 1.1d-69))) then
tmp = (x / y) - 2.0d0
else
tmp = 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 <= -1.85e-31) || !(t <= 1.1e-69)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.85e-31) or not (t <= 1.1e-69): tmp = (x / y) - 2.0 else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.85e-31) || !(t <= 1.1e-69)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(2.0 / Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.85e-31) || ~((t <= 1.1e-69))) tmp = (x / y) - 2.0; else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.85e-31], N[Not[LessEqual[t, 1.1e-69]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{-31} \lor \neg \left(t \leq 1.1 \cdot 10^{-69}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if t < -1.8499999999999999e-31 or 1.1e-69 < t Initial program 76.1%
Taylor expanded in t around inf 80.5%
if -1.8499999999999999e-31 < t < 1.1e-69Initial program 98.9%
+-commutative98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
unsub-neg98.9%
*-commutative98.9%
associate-*r*98.9%
distribute-rgt1-in98.9%
associate-/l*98.9%
fma-neg98.9%
*-commutative98.9%
fma-define98.9%
*-commutative98.9%
distribute-frac-neg98.9%
remove-double-neg98.9%
Simplified98.9%
Taylor expanded in t around inf 98.9%
associate--l+98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.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 51.6%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1.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.0d0)) then
tmp = -2.0d0
else if (t <= 1.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.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 1.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.0) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 1 < t Initial program 73.0%
Taylor expanded in z around inf 85.5%
div-sub85.5%
sub-neg85.5%
*-inverses85.5%
metadata-eval85.5%
distribute-lft-in85.5%
associate-*r/85.5%
metadata-eval85.5%
metadata-eval85.5%
Simplified85.5%
Taylor expanded in x around 0 42.8%
sub-neg42.8%
associate-*r/42.8%
metadata-eval42.8%
metadata-eval42.8%
Simplified42.8%
Taylor expanded in t around inf 42.3%
if -1 < t < 1Initial program 99.0%
Taylor expanded in t around 0 77.4%
associate-*r/77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in z around inf 31.0%
Final simplification36.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 85.8%
Taylor expanded in z around inf 70.8%
div-sub70.8%
sub-neg70.8%
*-inverses70.8%
metadata-eval70.8%
distribute-lft-in70.8%
associate-*r/70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in x around 0 37.6%
sub-neg37.6%
associate-*r/37.6%
metadata-eval37.6%
metadata-eval37.6%
Simplified37.6%
Taylor expanded in t around inf 22.5%
Final simplification22.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 2024077
(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))))