
(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 13 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 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.1%
associate--l+99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
associate-*r/99.1%
distribute-lft-in99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -4.2e+53) (not (<= (/ x y) 9e+15))) (+ (/ 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 (((x / y) <= -4.2e+53) || !((x / y) <= 9e+15)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-4.2d+53)) .or. (.not. ((x / y) <= 9d+15))) then
tmp = (x / y) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -4.2e+53) || !((x / y) <= 9e+15)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -4.2e+53) or not ((x / y) <= 9e+15): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -4.2e+53) || !(Float64(x / y) <= 9e+15)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + 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 (((x / y) <= -4.2e+53) || ~(((x / y) <= 9e+15))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -4.2e+53], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9e+15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -4.2 \cdot 10^{+53} \lor \neg \left(\frac{x}{y} \leq 9 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.2000000000000004e53 or 9e15 < (/.f64 x y) Initial program 86.7%
Taylor expanded in z around inf 84.3%
div-sub84.3%
sub-neg84.3%
*-inverses84.3%
metadata-eval84.3%
distribute-lft-in84.3%
metadata-eval84.3%
associate-*r/84.3%
metadata-eval84.3%
Simplified84.3%
Taylor expanded in t around 0 84.3%
if -4.2000000000000004e53 < (/.f64 x y) < 9e15Initial program 87.1%
+-commutative87.1%
remove-double-neg87.1%
distribute-frac-neg87.1%
unsub-neg87.1%
*-commutative87.1%
associate-*r*87.1%
distribute-rgt1-in87.1%
associate-/l*87.0%
fma-neg87.0%
*-commutative87.0%
fma-define87.0%
*-commutative87.0%
distribute-frac-neg87.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-/r*98.5%
metadata-eval98.5%
associate-*r/98.5%
*-lft-identity98.5%
associate-*l/98.4%
associate-*l/98.5%
*-lft-identity98.5%
associate-*l/98.4%
distribute-rgt-in98.4%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -130000.0) (not (<= (/ x y) 145000.0))) (+ (/ x y) (/ 2.0 (* z t))) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -130000.0) || !((x / y) <= 145000.0)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-130000.0d0)) .or. (.not. ((x / y) <= 145000.0d0))) then
tmp = (x / y) + (2.0d0 / (z * t))
else
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -130000.0) || !((x / y) <= 145000.0)) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -130000.0) or not ((x / y) <= 145000.0): tmp = (x / y) + (2.0 / (z * t)) else: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -130000.0) || !(Float64(x / y) <= 145000.0)) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = Float64(-2.0 + 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 (((x / y) <= -130000.0) || ~(((x / y) <= 145000.0))) tmp = (x / y) + (2.0 / (z * t)); else tmp = -2.0 + ((2.0 + (2.0 / z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -130000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 145000.0]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -130000 \lor \neg \left(\frac{x}{y} \leq 145000\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.3e5 or 145000 < (/.f64 x y) Initial program 87.4%
Taylor expanded in z around 0 88.0%
if -1.3e5 < (/.f64 x y) < 145000Initial program 86.4%
+-commutative86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
*-commutative86.4%
associate-*r*86.4%
distribute-rgt1-in86.4%
associate-/l*86.3%
fma-neg86.3%
*-commutative86.3%
fma-define86.3%
*-commutative86.3%
distribute-frac-neg86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-/r*99.9%
metadata-eval99.9%
associate-*r/99.9%
*-lft-identity99.9%
associate-*l/99.8%
associate-*l/99.9%
*-lft-identity99.9%
associate-*l/99.8%
distribute-rgt-in99.8%
associate-*l/99.8%
*-lft-identity99.8%
Simplified99.8%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -9e+53)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 1.65e+16)
(+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))
(+ (/ x y) (+ -2.0 (/ 2.0 t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9e+53) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1.65e+16) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (-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) <= (-9d+53)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 1.65d+16) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + ((-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) <= -9e+53) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1.65e+16) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (-2.0 + (2.0 / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -9e+53: tmp = (x / y) + (2.0 / t) elif (x / y) <= 1.65e+16: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + (-2.0 + (2.0 / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -9e+53) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 1.65e+16) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + 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) <= -9e+53) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 1.65e+16) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + (-2.0 + (2.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -9e+53], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1.65e+16], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -9 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 1.65 \cdot 10^{+16}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -9.0000000000000004e53Initial program 80.3%
Taylor expanded in z around inf 84.7%
div-sub84.7%
sub-neg84.7%
*-inverses84.7%
metadata-eval84.7%
distribute-lft-in84.7%
metadata-eval84.7%
associate-*r/84.7%
metadata-eval84.7%
Simplified84.7%
Taylor expanded in t around 0 84.7%
if -9.0000000000000004e53 < (/.f64 x y) < 1.65e16Initial program 87.1%
+-commutative87.1%
remove-double-neg87.1%
distribute-frac-neg87.1%
unsub-neg87.1%
*-commutative87.1%
associate-*r*87.1%
distribute-rgt1-in87.1%
associate-/l*87.0%
fma-neg87.0%
*-commutative87.0%
fma-define87.0%
*-commutative87.0%
distribute-frac-neg87.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-/r*98.5%
metadata-eval98.5%
associate-*r/98.5%
*-lft-identity98.5%
associate-*l/98.4%
associate-*l/98.5%
*-lft-identity98.5%
associate-*l/98.4%
distribute-rgt-in98.4%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
if 1.65e16 < (/.f64 x y) Initial program 92.2%
Taylor expanded in z around inf 83.9%
div-sub83.9%
sub-neg83.9%
*-inverses83.9%
metadata-eval83.9%
distribute-lft-in83.9%
metadata-eval83.9%
associate-*r/83.9%
metadata-eval83.9%
Simplified83.9%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -7.5e+53) (not (<= (/ x y) 1.35e+17))) (/ x y) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -7.5e+53) || !((x / y) <= 1.35e+17)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((x / y) <= (-7.5d+53)) .or. (.not. ((x / y) <= 1.35d+17))) then
tmp = x / y
else
tmp = (-2.0d0) + ((2.0d0 / z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -7.5e+53) || !((x / y) <= 1.35e+17)) {
tmp = x / y;
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -7.5e+53) or not ((x / y) <= 1.35e+17): tmp = x / y else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -7.5e+53) || !(Float64(x / y) <= 1.35e+17)) tmp = Float64(x / y); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -7.5e+53) || ~(((x / y) <= 1.35e+17))) tmp = x / y; else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -7.5e+53], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1.35e+17]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -7.5 \cdot 10^{+53} \lor \neg \left(\frac{x}{y} \leq 1.35 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -7.4999999999999997e53 or 1.35e17 < (/.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 74.1%
if -7.4999999999999997e53 < (/.f64 x y) < 1.35e17Initial program 87.1%
+-commutative87.1%
remove-double-neg87.1%
distribute-frac-neg87.1%
unsub-neg87.1%
*-commutative87.1%
associate-*r*87.1%
distribute-rgt1-in87.1%
associate-/l*87.0%
fma-neg87.0%
*-commutative87.0%
fma-define87.0%
*-commutative87.0%
distribute-frac-neg87.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 98.4%
sub-neg98.4%
metadata-eval98.4%
+-commutative98.4%
associate-*r/98.4%
metadata-eval98.4%
associate-/r*98.5%
metadata-eval98.5%
associate-*r/98.5%
*-lft-identity98.5%
associate-*l/98.4%
associate-*l/98.5%
*-lft-identity98.5%
associate-*l/98.4%
distribute-rgt-in98.4%
associate-*l/98.4%
*-lft-identity98.4%
Simplified98.4%
Taylor expanded in z around 0 79.6%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1.28e-14) (not (<= (/ x y) 3.9e+15))) (+ (/ x y) (/ 2.0 t)) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1.28e-14) || !((x / y) <= 3.9e+15)) {
tmp = (x / y) + (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 (((x / y) <= (-1.28d-14)) .or. (.not. ((x / y) <= 3.9d+15))) then
tmp = (x / y) + (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 (((x / y) <= -1.28e-14) || !((x / y) <= 3.9e+15)) {
tmp = (x / y) + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1.28e-14) or not ((x / y) <= 3.9e+15): tmp = (x / y) + (2.0 / t) else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1.28e-14) || !(Float64(x / y) <= 3.9e+15)) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); else tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1.28e-14) || ~(((x / y) <= 3.9e+15))) tmp = (x / y) + (2.0 / t); else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.28e-14], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.9e+15]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.28 \cdot 10^{-14} \lor \neg \left(\frac{x}{y} \leq 3.9 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.28e-14 or 3.9e15 < (/.f64 x y) Initial program 87.4%
Taylor expanded in z around inf 82.9%
div-sub82.9%
sub-neg82.9%
*-inverses82.9%
metadata-eval82.9%
distribute-lft-in82.9%
metadata-eval82.9%
associate-*r/82.9%
metadata-eval82.9%
Simplified82.9%
Taylor expanded in t around 0 82.5%
if -1.28e-14 < (/.f64 x y) < 3.9e15Initial program 86.4%
+-commutative86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
*-commutative86.4%
associate-*r*86.4%
distribute-rgt1-in86.4%
associate-/l*86.3%
fma-neg86.3%
*-commutative86.3%
fma-define86.3%
*-commutative86.3%
distribute-frac-neg86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.0%
sub-neg99.0%
metadata-eval99.0%
+-commutative99.0%
associate-*r/99.0%
metadata-eval99.0%
associate-/r*99.1%
metadata-eval99.1%
associate-*r/99.1%
*-lft-identity99.1%
associate-*l/99.0%
associate-*l/99.1%
*-lft-identity99.1%
associate-*l/99.0%
distribute-rgt-in99.0%
associate-*l/99.1%
*-lft-identity99.1%
Simplified99.1%
Taylor expanded in z around 0 81.5%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -128000.0) (not (<= (/ x y) 250000.0))) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -128000.0) || !((x / y) <= 250000.0)) {
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) <= (-128000.0d0)) .or. (.not. ((x / y) <= 250000.0d0))) 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) <= -128000.0) || !((x / y) <= 250000.0)) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -128000.0) or not ((x / y) <= 250000.0): 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) <= -128000.0) || !(Float64(x / y) <= 250000.0)) 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) <= -128000.0) || ~(((x / y) <= 250000.0))) 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], -128000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 250000.0]], $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 -128000 \lor \neg \left(\frac{x}{y} \leq 250000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -128000 or 2.5e5 < (/.f64 x y) Initial program 87.4%
Taylor expanded in x around inf 70.9%
if -128000 < (/.f64 x y) < 2.5e5Initial program 86.4%
+-commutative86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
*-commutative86.4%
associate-*r*86.4%
distribute-rgt1-in86.4%
associate-/l*86.3%
fma-neg86.3%
*-commutative86.3%
fma-define86.3%
*-commutative86.3%
distribute-frac-neg86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 51.2%
sub-neg51.2%
associate-*r/51.2%
metadata-eval51.2%
metadata-eval51.2%
Simplified51.2%
Final simplification61.1%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -13500.0) (not (<= (/ x y) 35000.0))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -13500.0) || !((x / y) <= 35000.0)) {
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) <= (-13500.0d0)) .or. (.not. ((x / y) <= 35000.0d0))) 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) <= -13500.0) || !((x / y) <= 35000.0)) {
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) <= -13500.0) or not ((x / y) <= 35000.0): 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) <= -13500.0) || !(Float64(x / y) <= 35000.0)) 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) <= -13500.0) || ~(((x / y) <= 35000.0))) 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], -13500.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 35000.0]], $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 -13500 \lor \neg \left(\frac{x}{y} \leq 35000\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -13500 or 35000 < (/.f64 x y) Initial program 87.4%
Taylor expanded in t around inf 71.8%
if -13500 < (/.f64 x y) < 35000Initial program 86.4%
+-commutative86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
*-commutative86.4%
associate-*r*86.4%
distribute-rgt1-in86.4%
associate-/l*86.3%
fma-neg86.3%
*-commutative86.3%
fma-define86.3%
*-commutative86.3%
distribute-frac-neg86.3%
remove-double-neg86.3%
Simplified86.3%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 51.2%
sub-neg51.2%
associate-*r/51.2%
metadata-eval51.2%
metadata-eval51.2%
Simplified51.2%
Final simplification61.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -9.8e-39) (not (<= (/ x y) 2.0))) (/ x y) -2.0))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -9.8e-39) || !((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) <= (-9.8d-39)) .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) <= -9.8e-39) || !((x / y) <= 2.0)) {
tmp = x / y;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -9.8e-39) 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) <= -9.8e-39) || !(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) <= -9.8e-39) || ~(((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], -9.8e-39], 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 -9.8 \cdot 10^{-39} \lor \neg \left(\frac{x}{y} \leq 2\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.79999999999999947e-39 or 2 < (/.f64 x y) Initial program 88.1%
Taylor expanded in x around inf 67.4%
if -9.79999999999999947e-39 < (/.f64 x y) < 2Initial program 85.7%
+-commutative85.7%
remove-double-neg85.7%
distribute-frac-neg85.7%
unsub-neg85.7%
*-commutative85.7%
associate-*r*85.7%
distribute-rgt1-in85.7%
associate-/l*85.6%
fma-neg85.6%
*-commutative85.6%
fma-define85.6%
*-commutative85.6%
distribute-frac-neg85.6%
remove-double-neg85.6%
Simplified85.6%
Taylor expanded in t around inf 99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
associate-*r/99.8%
distribute-lft-in99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 34.1%
Final simplification51.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.06e-34) (not (<= z 7.6e-86))) (- (/ x y) 2.0) (/ 2.0 (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.06e-34) || !(z <= 7.6e-86)) {
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 ((z <= (-1.06d-34)) .or. (.not. (z <= 7.6d-86))) 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 ((z <= -1.06e-34) || !(z <= 7.6e-86)) {
tmp = (x / y) - 2.0;
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.06e-34) or not (z <= 7.6e-86): tmp = (x / y) - 2.0 else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.06e-34) || !(z <= 7.6e-86)) 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 ((z <= -1.06e-34) || ~((z <= 7.6e-86))) tmp = (x / y) - 2.0; else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.06e-34], N[Not[LessEqual[z, 7.6e-86]], $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}\;z \leq -1.06 \cdot 10^{-34} \lor \neg \left(z \leq 7.6 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.06000000000000006e-34 or 7.6e-86 < z Initial program 78.1%
Taylor expanded in t around inf 68.5%
if -1.06000000000000006e-34 < z < 7.6e-86Initial program 98.0%
+-commutative98.0%
remove-double-neg98.0%
distribute-frac-neg98.0%
unsub-neg98.0%
*-commutative98.0%
associate-*r*98.0%
distribute-rgt1-in98.0%
associate-/l*97.9%
fma-neg97.9%
*-commutative97.9%
fma-define97.9%
*-commutative97.9%
distribute-frac-neg97.9%
remove-double-neg97.9%
Simplified97.9%
Taylor expanded in t around inf 98.0%
associate--l+98.0%
+-commutative98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
associate-*r/98.0%
distribute-lft-in98.0%
metadata-eval98.0%
associate-*r/98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in z around 0 71.1%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.9e-35) (not (<= z 5.4e-86))) (- (/ x y) 2.0) (/ (/ 2.0 t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e-35) || !(z <= 5.4e-86)) {
tmp = (x / y) - 2.0;
} else {
tmp = (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 <= (-3.9d-35)) .or. (.not. (z <= 5.4d-86))) then
tmp = (x / y) - 2.0d0
else
tmp = (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 <= -3.9e-35) || !(z <= 5.4e-86)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 / t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.9e-35) or not (z <= 5.4e-86): tmp = (x / y) - 2.0 else: tmp = (2.0 / t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.9e-35) || !(z <= 5.4e-86)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 / t) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.9e-35) || ~((z <= 5.4e-86))) tmp = (x / y) - 2.0; else tmp = (2.0 / t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.9e-35], N[Not[LessEqual[z, 5.4e-86]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-35} \lor \neg \left(z \leq 5.4 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -3.8999999999999998e-35 or 5.39999999999999985e-86 < z Initial program 78.1%
Taylor expanded in t around inf 68.5%
if -3.8999999999999998e-35 < z < 5.39999999999999985e-86Initial program 98.0%
Taylor expanded in z around 0 86.5%
associate-/r*86.6%
Simplified86.6%
Taylor expanded in x around 0 71.1%
associate-/r*71.2%
Simplified71.2%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1500000.0) -2.0 (if (<= t 1.98e-13) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1500000.0) {
tmp = -2.0;
} else if (t <= 1.98e-13) {
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 <= (-1500000.0d0)) then
tmp = -2.0d0
else if (t <= 1.98d-13) 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 <= -1500000.0) {
tmp = -2.0;
} else if (t <= 1.98e-13) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1500000.0: tmp = -2.0 elif t <= 1.98e-13: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1500000.0) tmp = -2.0; elseif (t <= 1.98e-13) 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 <= -1500000.0) tmp = -2.0; elseif (t <= 1.98e-13) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1500000.0], -2.0, If[LessEqual[t, 1.98e-13], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1500000:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1.98 \cdot 10^{-13}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.5e6 or 1.97999999999999989e-13 < t Initial program 75.6%
+-commutative75.6%
remove-double-neg75.6%
distribute-frac-neg75.6%
unsub-neg75.6%
*-commutative75.6%
associate-*r*75.6%
distribute-rgt1-in75.6%
associate-/l*75.5%
fma-neg75.5%
*-commutative75.5%
fma-define75.5%
*-commutative75.5%
distribute-frac-neg75.5%
remove-double-neg75.5%
Simplified75.5%
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 53.1%
associate--l+53.1%
associate-*r/53.1%
metadata-eval53.1%
associate-*r/53.1%
metadata-eval53.1%
Simplified53.1%
Taylor expanded in t around inf 32.4%
if -1.5e6 < t < 1.97999999999999989e-13Initial program 98.2%
Taylor expanded in t around 0 78.9%
associate-*r/78.9%
metadata-eval78.9%
Simplified78.9%
Taylor expanded in z around inf 29.3%
Final simplification30.9%
(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 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.1%
associate--l+99.1%
+-commutative99.1%
sub-neg99.1%
metadata-eval99.1%
+-commutative99.1%
associate-*r/99.1%
distribute-lft-in99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 66.3%
associate--l+66.3%
associate-*r/66.3%
metadata-eval66.3%
associate-*r/66.3%
metadata-eval66.3%
Simplified66.3%
Taylor expanded in t around inf 17.5%
Final simplification17.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 2024078
(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))))