
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((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 = (x / y) + ((-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 88.9%
sub-neg88.9%
distribute-rgt-in88.9%
*-lft-identity88.9%
associate-+r+88.9%
cancel-sign-sub-inv88.9%
div-sub81.9%
associate-*r*81.9%
associate-*l/81.9%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ 2.0 (* z t)))))
(if (<= (/ x y) -0.09)
(- (/ x y) 2.0)
(if (<= (/ x y) -3.1e-299)
t_1
(if (<= (/ x y) 0.0)
(+ -2.0 (/ 2.0 t))
(if (<= (/ x y) 1.9e+15) t_1 (/ x y)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (2.0 / (z * t));
double tmp;
if ((x / y) <= -0.09) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= -3.1e-299) {
tmp = t_1;
} else if ((x / y) <= 0.0) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 1.9e+15) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + (2.0d0 / (z * t))
if ((x / y) <= (-0.09d0)) then
tmp = (x / y) - 2.0d0
else if ((x / y) <= (-3.1d-299)) then
tmp = t_1
else if ((x / y) <= 0.0d0) then
tmp = (-2.0d0) + (2.0d0 / t)
else if ((x / y) <= 1.9d+15) then
tmp = t_1
else
tmp = x / y
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 / (z * t));
double tmp;
if ((x / y) <= -0.09) {
tmp = (x / y) - 2.0;
} else if ((x / y) <= -3.1e-299) {
tmp = t_1;
} else if ((x / y) <= 0.0) {
tmp = -2.0 + (2.0 / t);
} else if ((x / y) <= 1.9e+15) {
tmp = t_1;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (2.0 / (z * t)) tmp = 0 if (x / y) <= -0.09: tmp = (x / y) - 2.0 elif (x / y) <= -3.1e-299: tmp = t_1 elif (x / y) <= 0.0: tmp = -2.0 + (2.0 / t) elif (x / y) <= 1.9e+15: tmp = t_1 else: tmp = x / y return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(2.0 / Float64(z * t))) tmp = 0.0 if (Float64(x / y) <= -0.09) tmp = Float64(Float64(x / y) - 2.0); elseif (Float64(x / y) <= -3.1e-299) tmp = t_1; elseif (Float64(x / y) <= 0.0) tmp = Float64(-2.0 + Float64(2.0 / t)); elseif (Float64(x / y) <= 1.9e+15) tmp = t_1; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (2.0 / (z * t)); tmp = 0.0; if ((x / y) <= -0.09) tmp = (x / y) - 2.0; elseif ((x / y) <= -3.1e-299) tmp = t_1; elseif ((x / y) <= 0.0) tmp = -2.0 + (2.0 / t); elseif ((x / y) <= 1.9e+15) tmp = t_1; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -0.09], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -3.1e-299], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 0.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.9e+15], t$95$1, N[(x / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -0.09:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{elif}\;\frac{x}{y} \leq -3.1 \cdot 10^{-299}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\frac{x}{y} \leq 0:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.9 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.089999999999999997Initial program 86.9%
sub-neg86.9%
distribute-rgt-in86.9%
*-lft-identity86.9%
associate-+r+86.9%
cancel-sign-sub-inv86.9%
div-sub81.4%
associate-*r*81.4%
associate-*l/81.4%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified100.0%
Taylor expanded in t around inf 72.1%
if -0.089999999999999997 < (/.f64 x y) < -3.1e-299 or 0.0 < (/.f64 x y) < 1.9e15Initial program 85.5%
sub-neg85.5%
distribute-rgt-in85.5%
*-lft-identity85.5%
associate-+r+85.5%
cancel-sign-sub-inv85.5%
div-sub77.0%
associate-*r*77.0%
associate-*l/77.0%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in z around 0 77.7%
associate-/r*77.6%
Simplified77.6%
Taylor expanded in x around 0 76.1%
sub-neg76.1%
associate-*r/76.1%
metadata-eval76.1%
associate-/r*76.0%
metadata-eval76.0%
+-commutative76.0%
associate-/r*76.1%
Simplified76.1%
if -3.1e-299 < (/.f64 x y) < 0.0Initial program 96.8%
sub-neg96.8%
distribute-rgt-in96.8%
*-lft-identity96.8%
associate-+r+96.8%
cancel-sign-sub-inv96.8%
div-sub88.3%
associate-*r*88.3%
associate-*l/88.3%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 79.4%
sub-neg79.4%
associate-*r/79.4%
metadata-eval79.4%
metadata-eval79.4%
+-commutative79.4%
Simplified79.4%
if 1.9e15 < (/.f64 x y) Initial program 91.9%
sub-neg91.9%
distribute-rgt-in91.9%
*-lft-identity91.9%
associate-+r+91.9%
cancel-sign-sub-inv91.9%
div-sub87.0%
associate-*r*87.0%
associate-*l/87.0%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around inf 70.3%
Final simplification74.3%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2.0)
(/ x y)
(if (<= (/ x y) -3.7e-302)
-2.0
(if (<= (/ x y) 7e-258) (/ 2.0 t) (if (<= (/ x y) 2.0) -2.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.0) {
tmp = x / y;
} else if ((x / y) <= -3.7e-302) {
tmp = -2.0;
} else if ((x / y) <= 7e-258) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-2.0d0)) then
tmp = x / y
else if ((x / y) <= (-3.7d-302)) then
tmp = -2.0d0
else if ((x / y) <= 7d-258) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.0d0) then
tmp = -2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2.0) {
tmp = x / y;
} else if ((x / y) <= -3.7e-302) {
tmp = -2.0;
} else if ((x / y) <= 7e-258) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2.0: tmp = x / y elif (x / y) <= -3.7e-302: tmp = -2.0 elif (x / y) <= 7e-258: tmp = 2.0 / t elif (x / y) <= 2.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -3.7e-302) tmp = -2.0; elseif (Float64(x / y) <= 7e-258) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.0) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2.0) tmp = x / y; elseif ((x / y) <= -3.7e-302) tmp = -2.0; elseif ((x / y) <= 7e-258) tmp = 2.0 / t; elseif ((x / y) <= 2.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -3.7e-302], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], 7e-258], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], -2.0, N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -3.7 \cdot 10^{-302}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq 7 \cdot 10^{-258}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2 or 2 < (/.f64 x y) Initial program 90.7%
sub-neg90.7%
distribute-rgt-in90.7%
*-lft-identity90.7%
associate-+r+90.7%
cancel-sign-sub-inv90.7%
div-sub84.8%
associate-*r*84.8%
associate-*l/84.8%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around inf 68.6%
if -2 < (/.f64 x y) < -3.7e-302 or 7.00000000000000003e-258 < (/.f64 x y) < 2Initial program 83.3%
sub-neg83.3%
distribute-rgt-in83.3%
*-lft-identity83.3%
associate-+r+83.3%
cancel-sign-sub-inv83.3%
div-sub75.1%
associate-*r*75.1%
associate-*l/75.1%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 98.8%
sub-neg98.8%
associate-*r/98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in t around inf 40.4%
if -3.7e-302 < (/.f64 x y) < 7.00000000000000003e-258Initial program 97.2%
sub-neg97.2%
distribute-rgt-in97.2%
*-lft-identity97.2%
associate-+r+97.2%
cancel-sign-sub-inv97.2%
div-sub89.7%
associate-*r*89.7%
associate-*l/89.7%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around 0 71.4%
associate-*r/71.4%
metadata-eval71.4%
Simplified71.4%
Taylor expanded in z around inf 44.2%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.45e-15))) (+ (/ x y) (- (/ 2.0 t) 2.0)) (+ (/ x y) (+ -2.0 (/ (/ 2.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.45e-15)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (x / y) + (-2.0 + ((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 <= (-1.0d0)) .or. (.not. (z <= 1.45d-15))) then
tmp = (x / y) + ((2.0d0 / t) - 2.0d0)
else
tmp = (x / y) + ((-2.0d0) + ((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 <= -1.0) || !(z <= 1.45e-15)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (x / y) + (-2.0 + ((2.0 / t) / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.45e-15): tmp = (x / y) + ((2.0 / t) - 2.0) else: tmp = (x / y) + (-2.0 + ((2.0 / t) / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.45e-15)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); else tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 / t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.45e-15))) tmp = (x / y) + ((2.0 / t) - 2.0); else tmp = (x / y) + (-2.0 + ((2.0 / t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.45e-15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1.45 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{\frac{2}{t}}{z}\right)\\
\end{array}
\end{array}
if z < -1 or 1.45000000000000009e-15 < z Initial program 78.3%
sub-neg78.3%
distribute-rgt-in78.3%
*-lft-identity78.3%
associate-+r+78.3%
cancel-sign-sub-inv78.3%
div-sub78.3%
associate-*r*78.3%
associate-*l/78.3%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 98.5%
associate--l+98.5%
associate-*r/98.5%
metadata-eval98.5%
Simplified98.5%
if -1 < z < 1.45000000000000009e-15Initial program 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
*-lft-identity99.9%
associate-+r+99.9%
cancel-sign-sub-inv99.9%
div-sub85.6%
associate-*r*85.6%
associate-*l/85.6%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in z around 0 99.4%
associate-/r*99.3%
Simplified99.3%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -7.5e-16) (not (<= (/ x y) 7.2e-7))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -7.5e-16) || !((x / y) <= 7.2e-7)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-7.5d-16)) .or. (.not. ((x / y) <= 7.2d-7))) then
tmp = (x / y) - 2.0d0
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -7.5e-16) || !((x / y) <= 7.2e-7)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -7.5e-16) or not ((x / y) <= 7.2e-7): tmp = (x / y) - 2.0 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -7.5e-16) || !(Float64(x / y) <= 7.2e-7)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -7.5e-16) || ~(((x / y) <= 7.2e-7))) tmp = (x / y) - 2.0; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -7.5e-16], N[Not[LessEqual[N[(x / y), $MachinePrecision], 7.2e-7]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -7.5 \cdot 10^{-16} \lor \neg \left(\frac{x}{y} \leq 7.2 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -7.5e-16 or 7.19999999999999989e-7 < (/.f64 x y) Initial program 89.3%
sub-neg89.3%
distribute-rgt-in89.3%
*-lft-identity89.3%
associate-+r+89.3%
cancel-sign-sub-inv89.3%
div-sub82.8%
associate-*r*82.8%
associate-*l/82.8%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
if -7.5e-16 < (/.f64 x y) < 7.19999999999999989e-7Initial program 88.5%
sub-neg88.5%
distribute-rgt-in88.5%
*-lft-identity88.5%
associate-+r+88.5%
cancel-sign-sub-inv88.5%
div-sub81.0%
associate-*r*81.0%
associate-*l/81.0%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-+l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 64.5%
sub-neg64.5%
associate-*r/64.5%
metadata-eval64.5%
metadata-eval64.5%
+-commutative64.5%
Simplified64.5%
Final simplification67.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.4e-96) (not (<= z 4e-17))) (+ (/ x y) (- (/ 2.0 t) 2.0)) (+ -2.0 (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4e-96) || !(z <= 4e-17)) {
tmp = (x / y) + ((2.0 / t) - 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 ((z <= (-3.4d-96)) .or. (.not. (z <= 4d-17))) then
tmp = (x / y) + ((2.0d0 / t) - 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 ((z <= -3.4e-96) || !(z <= 4e-17)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = -2.0 + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.4e-96) or not (z <= 4e-17): tmp = (x / y) + ((2.0 / t) - 2.0) else: tmp = -2.0 + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.4e-96) || !(z <= 4e-17)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); 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 <= -3.4e-96) || ~((z <= 4e-17))) tmp = (x / y) + ((2.0 / t) - 2.0); else tmp = -2.0 + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4e-96], N[Not[LessEqual[z, 4e-17]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-96} \lor \neg \left(z \leq 4 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -3.4000000000000001e-96 or 4.00000000000000029e-17 < z Initial program 81.3%
sub-neg81.3%
distribute-rgt-in81.3%
*-lft-identity81.3%
associate-+r+81.3%
cancel-sign-sub-inv81.3%
div-sub81.3%
associate-*r*81.3%
associate-*l/81.3%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 95.2%
associate--l+95.2%
associate-*r/95.2%
metadata-eval95.2%
Simplified95.2%
if -3.4000000000000001e-96 < z < 4.00000000000000029e-17Initial program 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
*-lft-identity99.9%
associate-+r+99.9%
cancel-sign-sub-inv99.9%
div-sub82.7%
associate-*r*82.7%
associate-*l/82.7%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in z around 0 99.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 75.3%
sub-neg75.3%
associate-*r/75.3%
metadata-eval75.3%
associate-/r*75.3%
metadata-eval75.3%
+-commutative75.3%
associate-/r*75.3%
Simplified75.3%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.45e-54) (not (<= z 7e-16))) (+ (/ x y) (- (/ 2.0 t) 2.0)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.45e-54) || !(z <= 7e-16)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} 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.45d-54)) .or. (.not. (z <= 7d-16))) then
tmp = (x / y) + ((2.0d0 / t) - 2.0d0)
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.45e-54) || !(z <= 7e-16)) {
tmp = (x / y) + ((2.0 / t) - 2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.45e-54) or not (z <= 7e-16): tmp = (x / y) + ((2.0 / t) - 2.0) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.45e-54) || !(z <= 7e-16)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) - 2.0)); 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.45e-54) || ~((z <= 7e-16))) tmp = (x / y) + ((2.0 / t) - 2.0); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.45e-54], N[Not[LessEqual[z, 7e-16]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $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.45 \cdot 10^{-54} \lor \neg \left(z \leq 7 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} - 2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -2.4500000000000001e-54 or 7.00000000000000035e-16 < z Initial program 80.0%
sub-neg80.0%
distribute-rgt-in80.0%
*-lft-identity80.0%
associate-+r+80.0%
cancel-sign-sub-inv80.0%
div-sub80.0%
associate-*r*80.0%
associate-*l/80.0%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 97.7%
associate--l+97.7%
associate-*r/97.7%
metadata-eval97.7%
Simplified97.7%
if -2.4500000000000001e-54 < z < 7.00000000000000035e-16Initial program 99.9%
clear-num99.8%
associate-/r*99.7%
frac-add78.4%
*-un-lft-identity78.4%
+-commutative78.4%
associate-*l*78.4%
fma-def78.4%
Applied egg-rr78.4%
Taylor expanded in z around 0 71.2%
associate-*r/71.2%
Simplified71.2%
Taylor expanded in z around 0 88.5%
associate-*r/88.5%
metadata-eval88.5%
+-commutative88.5%
associate-/r*88.5%
Simplified88.5%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1750000.0) (/ x y) (if (<= (/ x y) 1850000000000.0) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1750000.0) {
tmp = x / y;
} else if ((x / y) <= 1850000000000.0) {
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) <= (-1750000.0d0)) then
tmp = x / y
else if ((x / y) <= 1850000000000.0d0) 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) <= -1750000.0) {
tmp = x / y;
} else if ((x / y) <= 1850000000000.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1750000.0: tmp = x / y elif (x / y) <= 1850000000000.0: 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) <= -1750000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 1850000000000.0) 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) <= -1750000.0) tmp = x / y; elseif ((x / y) <= 1850000000000.0) 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], -1750000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1850000000000.0], 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 -1750000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 1850000000000:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.75e6 or 1.85e12 < (/.f64 x y) Initial program 90.3%
sub-neg90.3%
distribute-rgt-in90.3%
*-lft-identity90.3%
associate-+r+90.3%
cancel-sign-sub-inv90.3%
div-sub85.1%
associate-*r*85.1%
associate-*l/85.1%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around inf 70.7%
if -1.75e6 < (/.f64 x y) < 1.85e12Initial program 87.7%
sub-neg87.7%
distribute-rgt-in87.7%
*-lft-identity87.7%
associate-+r+87.7%
cancel-sign-sub-inv87.7%
div-sub79.2%
associate-*r*79.2%
associate-*l/79.2%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 98.2%
sub-neg98.2%
associate-*r/98.2%
metadata-eval98.2%
+-commutative98.2%
metadata-eval98.2%
associate-+l+98.2%
associate-*r/98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around inf 63.1%
sub-neg63.1%
associate-*r/63.1%
metadata-eval63.1%
metadata-eval63.1%
+-commutative63.1%
Simplified63.1%
Final simplification66.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -1.05e-97)
t_1
(if (<= z 1.25e-107)
(/ 2.0 (* z t))
(if (<= z 3.9e+91) t_1 (+ -2.0 (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -1.05e-97) {
tmp = t_1;
} else if (z <= 1.25e-107) {
tmp = 2.0 / (z * t);
} else if (z <= 3.9e+91) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x / y) - 2.0d0
if (z <= (-1.05d-97)) then
tmp = t_1
else if (z <= 1.25d-107) then
tmp = 2.0d0 / (z * t)
else if (z <= 3.9d+91) then
tmp = t_1
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 t_1 = (x / y) - 2.0;
double tmp;
if (z <= -1.05e-97) {
tmp = t_1;
} else if (z <= 1.25e-107) {
tmp = 2.0 / (z * t);
} else if (z <= 3.9e+91) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -1.05e-97: tmp = t_1 elif z <= 1.25e-107: tmp = 2.0 / (z * t) elif z <= 3.9e+91: tmp = t_1 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -1.05e-97) tmp = t_1; elseif (z <= 1.25e-107) tmp = Float64(2.0 / Float64(z * t)); elseif (z <= 3.9e+91) tmp = t_1; else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -1.05e-97) tmp = t_1; elseif (z <= 1.25e-107) tmp = 2.0 / (z * t); elseif (z <= 3.9e+91) tmp = t_1; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -1.05e-97], t$95$1, If[LessEqual[z, 1.25e-107], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+91], t$95$1, N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-107}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if z < -1.0500000000000001e-97 or 1.24999999999999993e-107 < z < 3.89999999999999968e91Initial program 87.6%
sub-neg87.6%
distribute-rgt-in87.6%
*-lft-identity87.6%
associate-+r+87.6%
cancel-sign-sub-inv87.6%
div-sub86.1%
associate-*r*86.1%
associate-*l/86.1%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 67.0%
if -1.0500000000000001e-97 < z < 1.24999999999999993e-107Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*r*99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
times-frac99.8%
fma-def99.8%
*-commutative99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in t around 0 70.7%
Taylor expanded in z around 0 70.7%
associate-/r*70.7%
Simplified70.7%
Taylor expanded in t around 0 70.7%
if 3.89999999999999968e91 < z Initial program 74.2%
sub-neg74.2%
distribute-rgt-in74.2%
*-lft-identity74.2%
associate-+r+74.2%
cancel-sign-sub-inv74.2%
div-sub74.2%
associate-*r*74.2%
associate-*l/74.2%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 71.2%
sub-neg71.2%
associate-*r/71.2%
metadata-eval71.2%
+-commutative71.2%
metadata-eval71.2%
associate-+l+71.2%
associate-*r/71.2%
metadata-eval71.2%
Simplified71.2%
Taylor expanded in z around inf 71.2%
sub-neg71.2%
associate-*r/71.2%
metadata-eval71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
Final simplification68.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.02e-11) (not (<= t 24.0))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.02e-11) || !(t <= 24.0)) {
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 <= (-1.02d-11)) .or. (.not. (t <= 24.0d0))) 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 <= -1.02e-11) || !(t <= 24.0)) {
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 <= -1.02e-11) or not (t <= 24.0): 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 <= -1.02e-11) || !(t <= 24.0)) 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 <= -1.02e-11) || ~((t <= 24.0))) 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, -1.02e-11], N[Not[LessEqual[t, 24.0]], $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 -1.02 \cdot 10^{-11} \lor \neg \left(t \leq 24\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -1.01999999999999994e-11 or 24 < t Initial program 79.5%
sub-neg79.5%
distribute-rgt-in79.5%
*-lft-identity79.5%
associate-+r+79.5%
cancel-sign-sub-inv79.5%
div-sub79.5%
associate-*r*79.5%
associate-*l/79.5%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 82.6%
if -1.01999999999999994e-11 < t < 24Initial program 99.7%
sub-neg99.7%
distribute-rgt-in99.7%
*-lft-identity99.7%
associate-+r+99.7%
cancel-sign-sub-inv99.7%
div-sub84.6%
associate-*r*84.6%
associate-*l/84.6%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 84.5%
sub-neg84.5%
associate-*r/84.5%
metadata-eval84.5%
+-commutative84.5%
metadata-eval84.5%
associate-+l+84.5%
associate-*r/84.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in t around 0 84.4%
associate-*r/84.4%
metadata-eval84.4%
Simplified84.4%
Final simplification83.4%
(FPCore (x y z t) :precision binary64 (if (<= t -4.6e-11) -2.0 (if (<= t 21000000000.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.6e-11) {
tmp = -2.0;
} else if (t <= 21000000000.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 <= (-4.6d-11)) then
tmp = -2.0d0
else if (t <= 21000000000.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 <= -4.6e-11) {
tmp = -2.0;
} else if (t <= 21000000000.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.6e-11: tmp = -2.0 elif t <= 21000000000.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.6e-11) tmp = -2.0; elseif (t <= 21000000000.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 <= -4.6e-11) tmp = -2.0; elseif (t <= 21000000000.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.6e-11], -2.0, If[LessEqual[t, 21000000000.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{-11}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 21000000000:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -4.60000000000000027e-11 or 2.1e10 < t Initial program 79.2%
sub-neg79.2%
distribute-rgt-in79.2%
*-lft-identity79.2%
associate-+r+79.2%
cancel-sign-sub-inv79.2%
div-sub79.2%
associate-*r*79.2%
associate-*l/79.2%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 54.7%
sub-neg54.7%
associate-*r/54.7%
metadata-eval54.7%
+-commutative54.7%
metadata-eval54.7%
associate-+l+54.7%
associate-*r/54.7%
metadata-eval54.7%
Simplified54.7%
Taylor expanded in t around inf 38.1%
if -4.60000000000000027e-11 < t < 2.1e10Initial program 99.7%
sub-neg99.7%
distribute-rgt-in99.7%
*-lft-identity99.7%
associate-+r+99.7%
cancel-sign-sub-inv99.7%
div-sub84.9%
associate-*r*84.9%
associate-*l/84.9%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 83.6%
sub-neg83.6%
associate-*r/83.6%
metadata-eval83.6%
+-commutative83.6%
metadata-eval83.6%
associate-+l+83.6%
associate-*r/83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in t around 0 83.5%
associate-*r/83.5%
metadata-eval83.5%
Simplified83.5%
Taylor expanded in z around inf 43.3%
Final simplification40.6%
(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 88.9%
sub-neg88.9%
distribute-rgt-in88.9%
*-lft-identity88.9%
associate-+r+88.9%
cancel-sign-sub-inv88.9%
div-sub81.9%
associate-*r*81.9%
associate-*l/81.9%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 68.4%
sub-neg68.4%
associate-*r/68.4%
metadata-eval68.4%
+-commutative68.4%
metadata-eval68.4%
associate-+l+68.4%
associate-*r/68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in t around inf 21.4%
Final simplification21.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 2023229
(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))))