
(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 z)) t) 2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + (((2.0d0 + (2.0d0 / z)) / t) - 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) - 2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) - 2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} - 2\right)
\end{array}
Initial program 83.0%
+-commutative83.0%
remove-double-neg83.0%
distribute-frac-neg83.0%
unsub-neg83.0%
*-commutative83.0%
associate-*r*83.0%
distribute-rgt1-in83.0%
associate-/l*83.0%
fma-neg83.0%
*-commutative83.0%
fma-define83.0%
*-commutative83.0%
distribute-frac-neg83.0%
remove-double-neg83.0%
Simplified83.0%
Taylor expanded in t around inf 98.7%
+-commutative98.7%
associate--l+98.7%
associate-*r/98.7%
distribute-lft-in98.7%
metadata-eval98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2000000000.0)
(/ x y)
(if (<= (/ x y) -5e-38)
-2.0
(if (<= (/ x y) -1e-200) (/ 2.0 t) (if (<= (/ x y) 2e-5) -2.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2000000000.0) {
tmp = x / y;
} else if ((x / y) <= -5e-38) {
tmp = -2.0;
} else if ((x / y) <= -1e-200) {
tmp = 2.0 / t;
} else if ((x / y) <= 2e-5) {
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) <= (-2000000000.0d0)) then
tmp = x / y
else if ((x / y) <= (-5d-38)) then
tmp = -2.0d0
else if ((x / y) <= (-1d-200)) then
tmp = 2.0d0 / t
else if ((x / y) <= 2d-5) 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) <= -2000000000.0) {
tmp = x / y;
} else if ((x / y) <= -5e-38) {
tmp = -2.0;
} else if ((x / y) <= -1e-200) {
tmp = 2.0 / t;
} else if ((x / y) <= 2e-5) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2000000000.0: tmp = x / y elif (x / y) <= -5e-38: tmp = -2.0 elif (x / y) <= -1e-200: tmp = 2.0 / t elif (x / y) <= 2e-5: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= -5e-38) tmp = -2.0; elseif (Float64(x / y) <= -1e-200) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2e-5) 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) <= -2000000000.0) tmp = x / y; elseif ((x / y) <= -5e-38) tmp = -2.0; elseif ((x / y) <= -1e-200) tmp = 2.0 / t; elseif ((x / y) <= 2e-5) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -5e-38], -2.0, If[LessEqual[N[(x / y), $MachinePrecision], -1e-200], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-5], -2.0, N[(x / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -5 \cdot 10^{-38}:\\
\;\;\;\;-2\\
\mathbf{elif}\;\frac{x}{y} \leq -1 \cdot 10^{-200}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e9 or 2.00000000000000016e-5 < (/.f64 x y) Initial program 85.3%
Taylor expanded in x around inf 69.4%
if -2e9 < (/.f64 x y) < -5.00000000000000033e-38 or -9.9999999999999998e-201 < (/.f64 x y) < 2.00000000000000016e-5Initial program 77.0%
Taylor expanded in t around inf 50.2%
Taylor expanded in x around 0 48.3%
if -5.00000000000000033e-38 < (/.f64 x y) < -9.9999999999999998e-201Initial program 92.2%
Taylor expanded in t around 0 79.9%
associate-*r/79.9%
metadata-eval79.9%
Simplified79.9%
Taylor expanded in z around inf 46.3%
Final simplification59.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+68) (not (<= (/ x y) 2e-5))) (* x (+ (/ 1.0 y) (/ 2.0 (* z (* x 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+68) || !((x / y) <= 2e-5)) {
tmp = x * ((1.0 / y) + (2.0 / (z * (x * 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+68)) .or. (.not. ((x / y) <= 2d-5))) then
tmp = x * ((1.0d0 / y) + (2.0d0 / (z * (x * 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+68) || !((x / y) <= 2e-5)) {
tmp = x * ((1.0 / y) + (2.0 / (z * (x * 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+68) or not ((x / y) <= 2e-5): tmp = x * ((1.0 / y) + (2.0 / (z * (x * 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+68) || !(Float64(x / y) <= 2e-5)) tmp = Float64(x * Float64(Float64(1.0 / y) + Float64(2.0 / Float64(z * Float64(x * 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+68) || ~(((x / y) <= 2e-5))) tmp = x * ((1.0 / y) + (2.0 / (z * (x * 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+68], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-5]], $MachinePrecision]], N[(x * N[(N[(1.0 / y), $MachinePrecision] + N[(2.0 / N[(z * N[(x * t), $MachinePrecision]), $MachinePrecision]), $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^{+68} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot \left(\frac{1}{y} + \frac{2}{z \cdot \left(x \cdot t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999953e67 or 2.00000000000000016e-5 < (/.f64 x y) Initial program 84.4%
Taylor expanded in z around 0 87.8%
Taylor expanded in x around inf 90.1%
associate-*r/90.1%
metadata-eval90.1%
*-commutative90.1%
associate-*r*89.2%
*-commutative89.2%
associate-*l*89.7%
Simplified89.7%
if -9.99999999999999953e67 < (/.f64 x y) < 2.00000000000000016e-5Initial program 81.8%
+-commutative81.8%
remove-double-neg81.8%
distribute-frac-neg81.8%
unsub-neg81.8%
*-commutative81.8%
associate-*r*81.8%
distribute-rgt1-in81.8%
associate-/l*81.8%
fma-neg81.8%
*-commutative81.8%
fma-define81.8%
*-commutative81.8%
distribute-frac-neg81.8%
remove-double-neg81.8%
Simplified81.8%
Taylor expanded in t around inf 99.9%
+-commutative99.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 95.9%
sub-neg95.9%
associate-*r/95.9%
metadata-eval95.9%
*-commutative95.9%
*-commutative95.9%
associate-/r*95.9%
*-lft-identity95.9%
associate-*l/95.9%
metadata-eval95.9%
associate-*r/95.9%
associate-*r*95.9%
*-commutative95.9%
distribute-rgt-in95.9%
associate-*r/95.9%
metadata-eval95.9%
associate-*l/95.9%
*-lft-identity95.9%
Simplified95.9%
Final simplification93.0%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+66)
(/ x y)
(if (<= (/ x y) -2e-63)
(/ 2.0 (* z t))
(if (<= (/ x y) 2e-9) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+66) {
tmp = x / y;
} else if ((x / y) <= -2e-63) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 2e-9) {
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) <= (-2d+66)) then
tmp = x / y
else if ((x / y) <= (-2d-63)) then
tmp = 2.0d0 / (z * t)
else if ((x / y) <= 2d-9) 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) <= -2e+66) {
tmp = x / y;
} else if ((x / y) <= -2e-63) {
tmp = 2.0 / (z * t);
} else if ((x / y) <= 2e-9) {
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) <= -2e+66: tmp = x / y elif (x / y) <= -2e-63: tmp = 2.0 / (z * t) elif (x / y) <= 2e-9: 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) <= -2e+66) tmp = Float64(x / y); elseif (Float64(x / y) <= -2e-63) tmp = Float64(2.0 / Float64(z * t)); elseif (Float64(x / y) <= 2e-9) 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) <= -2e+66) tmp = x / y; elseif ((x / y) <= -2e-63) tmp = 2.0 / (z * t); elseif ((x / y) <= 2e-9) 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], -2e+66], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -2e-63], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2e-9], 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 -2 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-63}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999989e66Initial program 84.1%
Taylor expanded in x around inf 81.0%
if -1.99999999999999989e66 < (/.f64 x y) < -2.00000000000000013e-63Initial program 86.8%
+-commutative86.8%
remove-double-neg86.8%
distribute-frac-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-*r*86.8%
distribute-rgt1-in86.8%
associate-/l*86.8%
fma-neg86.8%
*-commutative86.8%
fma-define86.8%
*-commutative86.8%
distribute-frac-neg86.8%
remove-double-neg86.8%
Simplified86.8%
Taylor expanded in t around inf 99.8%
+-commutative99.8%
associate--l+99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 55.9%
if -2.00000000000000013e-63 < (/.f64 x y) < 2.00000000000000012e-9Initial program 80.0%
+-commutative80.0%
remove-double-neg80.0%
distribute-frac-neg80.0%
unsub-neg80.0%
*-commutative80.0%
associate-*r*80.0%
distribute-rgt1-in80.0%
associate-/l*79.9%
fma-neg79.9%
*-commutative79.9%
fma-define79.9%
*-commutative79.9%
distribute-frac-neg79.9%
remove-double-neg79.9%
Simplified79.9%
Taylor expanded in t around inf 99.9%
+-commutative99.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 z around inf 70.3%
Taylor expanded in x around 0 70.2%
sub-neg70.2%
associate-*r/70.2%
metadata-eval70.2%
metadata-eval70.2%
+-commutative70.2%
Simplified70.2%
if 2.00000000000000012e-9 < (/.f64 x y) Initial program 85.2%
Taylor expanded in t around inf 69.4%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+68) (not (<= (/ x y) 5e+53))) (/ 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+68) || !((x / y) <= 5e+53)) {
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+68)) .or. (.not. ((x / y) <= 5d+53))) 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+68) || !((x / y) <= 5e+53)) {
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+68) or not ((x / y) <= 5e+53): 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+68) || !(Float64(x / y) <= 5e+53)) 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+68) || ~(((x / y) <= 5e+53))) 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+68], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e+53]], $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^{+68} \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999953e67 or 5.0000000000000004e53 < (/.f64 x y) Initial program 85.1%
Taylor expanded in x around inf 80.2%
if -9.99999999999999953e67 < (/.f64 x y) < 5.0000000000000004e53Initial program 81.5%
+-commutative81.5%
remove-double-neg81.5%
distribute-frac-neg81.5%
unsub-neg81.5%
*-commutative81.5%
associate-*r*81.5%
distribute-rgt1-in81.5%
associate-/l*81.5%
fma-neg81.5%
*-commutative81.5%
fma-define81.5%
*-commutative81.5%
distribute-frac-neg81.5%
remove-double-neg81.5%
Simplified81.5%
Taylor expanded in t around inf 99.9%
+-commutative99.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 92.3%
sub-neg92.3%
associate-*r/92.3%
metadata-eval92.3%
*-commutative92.3%
*-commutative92.3%
associate-/r*92.3%
*-lft-identity92.3%
associate-*l/92.2%
metadata-eval92.2%
associate-*r/92.2%
associate-*r*92.2%
*-commutative92.2%
distribute-rgt-in92.2%
associate-*r/92.2%
metadata-eval92.2%
associate-*l/92.3%
*-lft-identity92.3%
Simplified92.3%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+68) (not (<= (/ x y) 5e-57))) (+ (/ 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+68) || !((x / y) <= 5e-57)) {
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+68)) .or. (.not. ((x / y) <= 5d-57))) 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+68) || !((x / y) <= 5e-57)) {
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+68) or not ((x / y) <= 5e-57): 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+68) || !(Float64(x / y) <= 5e-57)) 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+68) || ~(((x / y) <= 5e-57))) 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+68], N[Not[LessEqual[N[(x / y), $MachinePrecision], 5e-57]], $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^{+68} \lor \neg \left(\frac{x}{y} \leq 5 \cdot 10^{-57}\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.99999999999999953e67 or 5.0000000000000002e-57 < (/.f64 x y) Initial program 84.2%
Taylor expanded in z around inf 84.5%
div-sub84.5%
sub-neg84.5%
*-inverses84.5%
metadata-eval84.5%
distribute-lft-in84.5%
associate-*r/84.5%
metadata-eval84.5%
metadata-eval84.5%
Simplified84.5%
if -9.99999999999999953e67 < (/.f64 x y) < 5.0000000000000002e-57Initial program 81.9%
+-commutative81.9%
remove-double-neg81.9%
distribute-frac-neg81.9%
unsub-neg81.9%
*-commutative81.9%
associate-*r*81.9%
distribute-rgt1-in81.9%
associate-/l*81.9%
fma-neg81.9%
*-commutative81.9%
fma-define81.9%
*-commutative81.9%
distribute-frac-neg81.9%
remove-double-neg81.9%
Simplified81.9%
Taylor expanded in t around inf 99.9%
+-commutative99.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.3%
sub-neg96.3%
associate-*r/96.3%
metadata-eval96.3%
*-commutative96.3%
*-commutative96.3%
associate-/r*96.3%
*-lft-identity96.3%
associate-*l/96.2%
metadata-eval96.2%
associate-*r/96.2%
associate-*r*96.2%
*-commutative96.2%
distribute-rgt-in96.2%
associate-*r/96.2%
metadata-eval96.2%
associate-*l/96.3%
*-lft-identity96.3%
Simplified96.3%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2000000000.0) (not (<= (/ x y) 2e-5))) (+ (/ x y) (/ 2.0 (* z t))) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2000000000.0) || !((x / y) <= 2e-5)) {
tmp = (x / y) + (2.0 / (z * 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) <= (-2000000000.0d0)) .or. (.not. ((x / y) <= 2d-5))) then
tmp = (x / y) + (2.0d0 / (z * 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) <= -2000000000.0) || !((x / y) <= 2e-5)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -2000000000.0) or not ((x / y) <= 2e-5): tmp = (x / y) + (2.0 / (z * 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) <= -2000000000.0) || !(Float64(x / y) <= 2e-5)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * 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) <= -2000000000.0) || ~(((x / y) <= 2e-5))) tmp = (x / y) + (2.0 / (z * 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], -2000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-5]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * 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 -2000000000 \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -2e9 or 2.00000000000000016e-5 < (/.f64 x y) Initial program 85.3%
Taylor expanded in z around 0 86.5%
if -2e9 < (/.f64 x y) < 2.00000000000000016e-5Initial program 80.4%
+-commutative80.4%
remove-double-neg80.4%
distribute-frac-neg80.4%
unsub-neg80.4%
*-commutative80.4%
associate-*r*80.4%
distribute-rgt1-in80.4%
associate-/l*80.4%
fma-neg80.4%
*-commutative80.4%
fma-define80.4%
*-commutative80.4%
distribute-frac-neg80.4%
remove-double-neg80.4%
Simplified80.4%
Taylor expanded in t around inf 99.9%
+-commutative99.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 98.5%
sub-neg98.5%
associate-*r/98.5%
metadata-eval98.5%
*-commutative98.5%
*-commutative98.5%
associate-/r*98.5%
*-lft-identity98.5%
associate-*l/98.4%
metadata-eval98.4%
associate-*r/98.4%
associate-*r*98.4%
*-commutative98.4%
distribute-rgt-in98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-*l/98.5%
*-lft-identity98.5%
Simplified98.5%
Final simplification92.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e+68) (not (<= (/ x y) 2e-5))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e+68) || !((x / y) <= 2e-5)) {
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) <= (-1d+68)) .or. (.not. ((x / y) <= 2d-5))) 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) <= -1e+68) || !((x / y) <= 2e-5)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e+68) or not ((x / y) <= 2e-5): 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) <= -1e+68) || !(Float64(x / y) <= 2e-5)) 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) <= -1e+68) || ~(((x / y) <= 2e-5))) 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], -1e+68], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-5]], $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 -1 \cdot 10^{+68} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999953e67 or 2.00000000000000016e-5 < (/.f64 x y) Initial program 84.4%
Taylor expanded in x around inf 75.0%
if -9.99999999999999953e67 < (/.f64 x y) < 2.00000000000000016e-5Initial program 81.8%
+-commutative81.8%
remove-double-neg81.8%
distribute-frac-neg81.8%
unsub-neg81.8%
*-commutative81.8%
associate-*r*81.8%
distribute-rgt1-in81.8%
associate-/l*81.8%
fma-neg81.8%
*-commutative81.8%
fma-define81.8%
*-commutative81.8%
distribute-frac-neg81.8%
remove-double-neg81.8%
Simplified81.8%
Taylor expanded in t around inf 99.9%
+-commutative99.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 z around inf 65.2%
Taylor expanded in x around 0 61.2%
sub-neg61.2%
associate-*r/61.2%
metadata-eval61.2%
metadata-eval61.2%
+-commutative61.2%
Simplified61.2%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -2e-33) (not (<= (/ x y) 2e-9))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -2e-33) || !((x / y) <= 2e-9)) {
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) <= (-2d-33)) .or. (.not. ((x / y) <= 2d-9))) 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) <= -2e-33) || !((x / y) <= 2e-9)) {
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) <= -2e-33) or not ((x / y) <= 2e-9): 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) <= -2e-33) || !(Float64(x / y) <= 2e-9)) 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) <= -2e-33) || ~(((x / y) <= 2e-9))) 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], -2e-33], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-9]], $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 -2 \cdot 10^{-33} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2.0000000000000001e-33 or 2.00000000000000012e-9 < (/.f64 x y) Initial program 84.4%
Taylor expanded in t around inf 69.3%
if -2.0000000000000001e-33 < (/.f64 x y) < 2.00000000000000012e-9Initial program 81.2%
+-commutative81.2%
remove-double-neg81.2%
distribute-frac-neg81.2%
unsub-neg81.2%
*-commutative81.2%
associate-*r*81.2%
distribute-rgt1-in81.2%
associate-/l*81.2%
fma-neg81.2%
*-commutative81.2%
fma-define81.2%
*-commutative81.2%
distribute-frac-neg81.2%
remove-double-neg81.2%
Simplified81.2%
Taylor expanded in t around inf 99.9%
+-commutative99.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 z around inf 68.6%
Taylor expanded in x around 0 68.6%
sub-neg68.6%
associate-*r/68.6%
metadata-eval68.6%
metadata-eval68.6%
+-commutative68.6%
Simplified68.6%
Final simplification69.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.2e-11) (not (<= t 1.8e+53))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.2e-11) || !(t <= 1.8e+53)) {
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 <= (-3.2d-11)) .or. (.not. (t <= 1.8d+53))) 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 <= -3.2e-11) || !(t <= 1.8e+53)) {
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 <= -3.2e-11) or not (t <= 1.8e+53): 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 <= -3.2e-11) || !(t <= 1.8e+53)) 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 <= -3.2e-11) || ~((t <= 1.8e+53))) 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, -3.2e-11], N[Not[LessEqual[t, 1.8e+53]], $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 -3.2 \cdot 10^{-11} \lor \neg \left(t \leq 1.8 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -3.19999999999999994e-11 or 1.8e53 < t Initial program 67.4%
Taylor expanded in t around inf 89.3%
if -3.19999999999999994e-11 < t < 1.8e53Initial program 97.5%
Taylor expanded in t around 0 75.0%
associate-*r/75.0%
metadata-eval75.0%
Simplified75.0%
Final simplification81.8%
(FPCore (x y z t) :precision binary64 (if (<= t -5e-9) -2.0 (if (<= t 3.05e-10) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5e-9) {
tmp = -2.0;
} else if (t <= 3.05e-10) {
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 <= (-5d-9)) then
tmp = -2.0d0
else if (t <= 3.05d-10) 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 <= -5e-9) {
tmp = -2.0;
} else if (t <= 3.05e-10) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5e-9: tmp = -2.0 elif t <= 3.05e-10: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5e-9) tmp = -2.0; elseif (t <= 3.05e-10) 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 <= -5e-9) tmp = -2.0; elseif (t <= 3.05e-10) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5e-9], -2.0, If[LessEqual[t, 3.05e-10], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-9}:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 3.05 \cdot 10^{-10}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -5.0000000000000001e-9 or 3.0499999999999998e-10 < t Initial program 69.6%
Taylor expanded in t around inf 85.6%
Taylor expanded in x around 0 38.3%
if -5.0000000000000001e-9 < t < 3.0499999999999998e-10Initial program 97.3%
Taylor expanded in t around 0 75.7%
associate-*r/75.7%
metadata-eval75.7%
Simplified75.7%
Taylor expanded in z around inf 35.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 83.0%
Taylor expanded in t around inf 58.0%
Taylor expanded in x around 0 21.1%
Final simplification21.1%
(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 2024079
(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))))