
(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 18 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 87.7%
+-commutative87.7%
remove-double-neg87.7%
distribute-frac-neg87.7%
unsub-neg87.7%
*-commutative87.7%
associate-*r*87.7%
distribute-rgt1-in87.7%
associate-/l*87.6%
fma-neg87.6%
*-commutative87.6%
fma-define87.6%
*-commutative87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around inf 99.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 (<= (/ x y) 1e+49) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (/ (+ x (* y (+ -2.0 (/ 2.0 t)))) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 1e+49) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x + (y * (-2.0 + (2.0 / t)))) / 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) <= 1d+49) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x + (y * ((-2.0d0) + (2.0d0 / t)))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 1e+49) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x + (y * (-2.0 + (2.0 / t)))) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 1e+49: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x + (y * (-2.0 + (2.0 / t)))) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 1e+49) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x + Float64(y * Float64(-2.0 + Float64(2.0 / t)))) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 1e+49) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x + (y * (-2.0 + (2.0 / t)))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 1e+49], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 10^{+49}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(-2 + \frac{2}{t}\right)}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < 9.99999999999999946e48Initial program 91.2%
+-commutative91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
*-commutative91.2%
associate-*r*91.2%
distribute-rgt1-in91.2%
associate-/l*91.1%
fma-neg91.1%
*-commutative91.1%
fma-define91.1%
*-commutative91.1%
distribute-frac-neg91.1%
remove-double-neg91.1%
Simplified91.1%
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 80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
associate-/r*80.5%
associate-*r/80.5%
associate-*l/80.5%
distribute-rgt-in80.5%
associate-*l/80.5%
*-lft-identity80.5%
Simplified80.5%
if 9.99999999999999946e48 < (/.f64 x y) Initial program 72.8%
Taylor expanded in z around inf 73.9%
div-sub73.9%
sub-neg73.9%
*-inverses73.9%
metadata-eval73.9%
distribute-lft-in73.9%
associate-*r/73.9%
metadata-eval73.9%
metadata-eval73.9%
Simplified73.9%
Taylor expanded in y around 0 74.0%
sub-neg74.0%
associate-*r/74.0%
metadata-eval74.0%
metadata-eval74.0%
Simplified74.0%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1.35e+22) (+ (/ 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) <= -1.35e+22) {
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) <= (-1.35d+22)) 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) <= -1.35e+22) {
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) <= -1.35e+22: 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) <= -1.35e+22) 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) <= -1.35e+22) 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[LessEqual[N[(x / y), $MachinePrecision], -1.35e+22], 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 -1.35 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.3500000000000001e22Initial program 88.2%
Taylor expanded in t around 0 100.0%
Taylor expanded in z around inf 82.8%
associate-*r/82.8%
metadata-eval82.8%
Simplified82.8%
if -1.3500000000000001e22 < (/.f64 x y) Initial program 87.6%
+-commutative87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
unsub-neg87.6%
*-commutative87.6%
associate-*r*87.6%
distribute-rgt1-in87.6%
associate-/l*87.5%
fma-neg87.5%
*-commutative87.5%
fma-define87.5%
*-commutative87.5%
distribute-frac-neg87.5%
remove-double-neg87.5%
Simplified87.5%
Taylor expanded in t around inf 98.9%
associate--l+98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in x around 0 81.2%
sub-neg81.2%
metadata-eval81.2%
+-commutative81.2%
associate-/r*81.2%
associate-*r/81.2%
associate-*l/81.2%
distribute-rgt-in81.2%
associate-*l/81.2%
*-lft-identity81.2%
Simplified81.2%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 1.48e+57) (+ -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) <= 1.48e+57) {
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) <= 1.48d+57) 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) <= 1.48e+57) {
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) <= 1.48e+57: 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) <= 1.48e+57) 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) <= 1.48e+57) 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], 1.48e+57], 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 1.48 \cdot 10^{+57}:\\
\;\;\;\;-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) < 1.47999999999999999e57Initial program 91.2%
+-commutative91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
*-commutative91.2%
associate-*r*91.2%
distribute-rgt1-in91.2%
associate-/l*91.1%
fma-neg91.1%
*-commutative91.1%
fma-define91.1%
*-commutative91.1%
distribute-frac-neg91.1%
remove-double-neg91.1%
Simplified91.1%
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 80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
associate-/r*80.5%
associate-*r/80.5%
associate-*l/80.5%
distribute-rgt-in80.5%
associate-*l/80.5%
*-lft-identity80.5%
Simplified80.5%
if 1.47999999999999999e57 < (/.f64 x y) Initial program 72.8%
Taylor expanded in z around inf 73.9%
div-sub73.9%
sub-neg73.9%
*-inverses73.9%
metadata-eval73.9%
distribute-lft-in73.9%
associate-*r/73.9%
metadata-eval73.9%
metadata-eval73.9%
Simplified73.9%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 2.1e+19) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (+ (/ x y) (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 2.1e+19) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (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) <= 2.1d+19) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + (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) <= 2.1e+19) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 2.1e+19: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 2.1e+19) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 2.1e+19) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 2.1e+19], 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[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 2.1 \cdot 10^{+19}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if (/.f64 x y) < 2.1e19Initial program 90.9%
+-commutative90.9%
remove-double-neg90.9%
distribute-frac-neg90.9%
unsub-neg90.9%
*-commutative90.9%
associate-*r*90.9%
distribute-rgt1-in90.9%
associate-/l*90.8%
fma-neg90.8%
*-commutative90.8%
fma-define90.8%
*-commutative90.8%
distribute-frac-neg90.8%
remove-double-neg90.8%
Simplified90.8%
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 80.9%
sub-neg80.9%
metadata-eval80.9%
+-commutative80.9%
associate-/r*80.8%
associate-*r/80.8%
associate-*l/80.9%
distribute-rgt-in80.9%
associate-*l/80.9%
*-lft-identity80.9%
Simplified80.9%
if 2.1e19 < (/.f64 x y) Initial program 76.2%
Taylor expanded in z around 0 93.7%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 1.15e+20) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 1.15e+20) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= 1.15d+20) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 1.15e+20) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 1.15e+20: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 1.15e+20) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 1.15e+20) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 1.15e+20], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 1.15 \cdot 10^{+20}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if (/.f64 x y) < 1.15e20Initial program 90.9%
+-commutative90.9%
remove-double-neg90.9%
distribute-frac-neg90.9%
unsub-neg90.9%
*-commutative90.9%
associate-*r*90.9%
distribute-rgt1-in90.9%
associate-/l*90.8%
fma-neg90.8%
*-commutative90.8%
fma-define90.8%
*-commutative90.8%
distribute-frac-neg90.8%
remove-double-neg90.8%
Simplified90.8%
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 80.9%
sub-neg80.9%
metadata-eval80.9%
+-commutative80.9%
associate-/r*80.8%
associate-*r/80.8%
associate-*l/80.9%
distribute-rgt-in80.9%
associate-*l/80.9%
*-lft-identity80.9%
Simplified80.9%
if 1.15e20 < (/.f64 x y) Initial program 76.2%
Taylor expanded in z around 0 93.7%
associate-/r*93.8%
Simplified93.8%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 1e+49) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t)) (/ (+ x (* 2.0 (/ y t))) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 1e+49) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x + (2.0 * (y / t))) / 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) <= 1d+49) then
tmp = (-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (x + (2.0d0 * (y / t))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 1e+49) {
tmp = -2.0 + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (x + (2.0 * (y / t))) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 1e+49: tmp = -2.0 + ((2.0 + (2.0 / z)) / t) else: tmp = (x + (2.0 * (y / t))) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 1e+49) tmp = Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(x + Float64(2.0 * Float64(y / t))) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= 1e+49) tmp = -2.0 + ((2.0 + (2.0 / z)) / t); else tmp = (x + (2.0 * (y / t))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 1e+49], N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(2.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 10^{+49}:\\
\;\;\;\;-2 + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 2 \cdot \frac{y}{t}}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < 9.99999999999999946e48Initial program 91.2%
+-commutative91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
*-commutative91.2%
associate-*r*91.2%
distribute-rgt1-in91.2%
associate-/l*91.1%
fma-neg91.1%
*-commutative91.1%
fma-define91.1%
*-commutative91.1%
distribute-frac-neg91.1%
remove-double-neg91.1%
Simplified91.1%
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 80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
associate-/r*80.5%
associate-*r/80.5%
associate-*l/80.5%
distribute-rgt-in80.5%
associate-*l/80.5%
*-lft-identity80.5%
Simplified80.5%
if 9.99999999999999946e48 < (/.f64 x y) Initial program 72.8%
Taylor expanded in z around inf 73.9%
div-sub73.9%
sub-neg73.9%
*-inverses73.9%
metadata-eval73.9%
distribute-lft-in73.9%
associate-*r/73.9%
metadata-eval73.9%
metadata-eval73.9%
Simplified73.9%
Taylor expanded in y around 0 74.0%
sub-neg74.0%
associate-*r/74.0%
metadata-eval74.0%
metadata-eval74.0%
Simplified74.0%
Taylor expanded in t around 0 74.0%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -3.55e+21) (/ x y) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -3.55e+21) {
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) <= (-3.55d+21)) 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) <= -3.55e+21) {
tmp = x / y;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -3.55e+21: 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) <= -3.55e+21) 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) <= -3.55e+21) tmp = x / y; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -3.55e+21], 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 -3.55 \cdot 10^{+21}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.55e21Initial program 88.2%
Taylor expanded in x around inf 71.8%
if -3.55e21 < (/.f64 x y) Initial program 87.6%
Taylor expanded in z around inf 66.2%
div-sub66.2%
sub-neg66.2%
*-inverses66.2%
metadata-eval66.2%
distribute-lft-in66.2%
associate-*r/66.2%
metadata-eval66.2%
metadata-eval66.2%
Simplified66.2%
Taylor expanded in x around 0 47.4%
sub-neg47.4%
associate-*r/47.4%
metadata-eval47.4%
metadata-eval47.4%
Simplified47.4%
Final simplification52.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.12e-11) (+ -2.0 (/ 2.0 t)) (+ -2.0 (/ (/ 2.0 z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.12e-11) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.12d-11)) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = (-2.0d0) + ((2.0d0 / z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.12e-11) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = -2.0 + ((2.0 / z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.12e-11: tmp = -2.0 + (2.0 / t) else: tmp = -2.0 + ((2.0 / z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.12e-11) tmp = Float64(-2.0 + 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 (z <= -1.12e-11) tmp = -2.0 + (2.0 / t); else tmp = -2.0 + ((2.0 / z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.12e-11], N[(-2.0 + 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}\;z \leq -1.12 \cdot 10^{-11}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -1.1200000000000001e-11Initial program 78.7%
Taylor expanded in z around inf 99.7%
div-sub99.7%
sub-neg99.7%
*-inverses99.7%
metadata-eval99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.4%
sub-neg66.4%
associate-*r/66.4%
metadata-eval66.4%
metadata-eval66.4%
Simplified66.4%
if -1.1200000000000001e-11 < z Initial program 91.5%
+-commutative91.5%
remove-double-neg91.5%
distribute-frac-neg91.5%
unsub-neg91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt1-in91.5%
associate-/l*91.5%
fma-neg91.5%
*-commutative91.5%
fma-define91.5%
*-commutative91.5%
distribute-frac-neg91.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in t around inf 98.8%
associate--l+98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
associate-*r/98.8%
distribute-lft-in98.8%
metadata-eval98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in x around 0 72.9%
sub-neg72.9%
metadata-eval72.9%
+-commutative72.9%
associate-/r*72.9%
associate-*r/72.9%
associate-*l/72.9%
distribute-rgt-in72.9%
associate-*l/72.9%
*-lft-identity72.9%
Simplified72.9%
Taylor expanded in z around 0 60.8%
Final simplification62.5%
(FPCore (x y z t) :precision binary64 (if (<= z 3.7e+59) (+ -2.0 (/ (/ 2.0 z) t)) (+ (/ x y) (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.7e+59) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = (x / y) + (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 (z <= 3.7d+59) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
else
tmp = (x / y) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.7e+59) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = (x / y) + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 3.7e+59: tmp = -2.0 + ((2.0 / z) / t) else: tmp = (x / y) + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 3.7e+59) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); else tmp = Float64(Float64(x / y) + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 3.7e+59) tmp = -2.0 + ((2.0 / z) / t); else tmp = (x / y) + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 3.7e+59], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.7 \cdot 10^{+59}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\end{array}
\end{array}
if z < 3.69999999999999997e59Initial program 91.2%
+-commutative91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
*-commutative91.2%
associate-*r*91.2%
distribute-rgt1-in91.2%
associate-/l*91.2%
fma-neg91.2%
*-commutative91.2%
fma-define91.2%
*-commutative91.2%
distribute-frac-neg91.2%
remove-double-neg91.2%
Simplified91.2%
Taylor expanded in t around inf 98.9%
associate--l+98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in x around 0 73.0%
sub-neg73.0%
metadata-eval73.0%
+-commutative73.0%
associate-/r*73.0%
associate-*r/73.0%
associate-*l/73.0%
distribute-rgt-in73.0%
associate-*l/73.0%
*-lft-identity73.0%
Simplified73.0%
Taylor expanded in z around 0 56.5%
if 3.69999999999999997e59 < z Initial program 72.1%
Taylor expanded in t around 0 79.1%
Taylor expanded in z around inf 79.1%
associate-*r/79.1%
metadata-eval79.1%
Simplified79.1%
Final simplification60.7%
(FPCore (x y z t) :precision binary64 (if (<= t -7.2e-27) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.2e-27) {
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 <= (-7.2d-27)) 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 <= -7.2e-27) {
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 <= -7.2e-27: 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 <= -7.2e-27) 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 <= -7.2e-27) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.2e-27], 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 -7.2 \cdot 10^{-27}:\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -7.1999999999999997e-27Initial program 78.0%
Taylor expanded in t around inf 81.7%
if -7.1999999999999997e-27 < t Initial program 91.0%
Taylor expanded in t around 0 63.1%
associate-*r/63.1%
metadata-eval63.1%
Simplified63.1%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) 4.2e+24) (/ 2.0 t) (/ x y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= 4.2e+24) {
tmp = 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) <= 4.2d+24) then
tmp = 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) <= 4.2e+24) {
tmp = 2.0 / t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= 4.2e+24: tmp = 2.0 / t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= 4.2e+24) tmp = 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) <= 4.2e+24) tmp = 2.0 / t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], 4.2e+24], N[(2.0 / t), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq 4.2 \cdot 10^{+24}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < 4.2000000000000003e24Initial program 91.0%
Taylor expanded in t around 0 57.3%
associate-*r/57.3%
metadata-eval57.3%
Simplified57.3%
Taylor expanded in z around inf 26.7%
if 4.2000000000000003e24 < (/.f64 x y) Initial program 75.3%
Taylor expanded in x around inf 68.5%
Final simplification35.4%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e+23) (+ -2.0 (/ 2.0 t)) (- (/ x y) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+23) {
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 (z <= (-4.2d+23)) 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 (z <= -4.2e+23) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e+23: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e+23) 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 (z <= -4.2e+23) tmp = -2.0 + (2.0 / t); else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e+23], 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}\;z \leq -4.2 \cdot 10^{+23}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if z < -4.2000000000000003e23Initial program 73.9%
Taylor expanded in z around inf 99.9%
div-sub100.0%
sub-neg100.0%
*-inverses100.0%
metadata-eval100.0%
distribute-lft-in100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 70.2%
sub-neg70.2%
associate-*r/70.2%
metadata-eval70.2%
metadata-eval70.2%
Simplified70.2%
if -4.2000000000000003e23 < z Initial program 92.1%
Taylor expanded in t around inf 46.5%
Final simplification52.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e-27) (+ -2.0 (/ 2.0 t)) (/ 2.0 (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-27) {
tmp = -2.0 + (2.0 / t);
} 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.8d-27)) then
tmp = (-2.0d0) + (2.0d0 / t)
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.8e-27) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = 2.0 / (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-27: tmp = -2.0 + (2.0 / t) else: tmp = 2.0 / (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-27) tmp = Float64(-2.0 + Float64(2.0 / t)); 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.8e-27) tmp = -2.0 + (2.0 / t); else tmp = 2.0 / (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-27], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-27}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-27Initial program 79.0%
Taylor expanded in z around inf 99.7%
div-sub99.7%
sub-neg99.7%
*-inverses99.7%
metadata-eval99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.9%
sub-neg66.9%
associate-*r/66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
if -1.7999999999999999e-27 < z Initial program 91.5%
+-commutative91.5%
remove-double-neg91.5%
distribute-frac-neg91.5%
unsub-neg91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt1-in91.5%
associate-/l*91.4%
fma-neg91.4%
*-commutative91.4%
fma-define91.4%
*-commutative91.4%
distribute-frac-neg91.4%
remove-double-neg91.4%
Simplified91.4%
Taylor expanded in t around inf 98.8%
associate--l+98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
associate-*r/98.8%
distribute-lft-in98.8%
metadata-eval98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in z around 0 46.0%
Final simplification52.3%
(FPCore (x y z t) :precision binary64 (if (<= z -7.5e-28) (+ -2.0 (/ 2.0 t)) (/ (/ 2.0 t) z)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.5e-28) {
tmp = -2.0 + (2.0 / t);
} 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 <= (-7.5d-28)) then
tmp = (-2.0d0) + (2.0d0 / t)
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 <= -7.5e-28) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (2.0 / t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.5e-28: tmp = -2.0 + (2.0 / t) else: tmp = (2.0 / t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.5e-28) tmp = Float64(-2.0 + Float64(2.0 / t)); 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 <= -7.5e-28) tmp = -2.0 + (2.0 / t); else tmp = (2.0 / t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.5e-28], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-28}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -7.5000000000000003e-28Initial program 79.0%
Taylor expanded in z around inf 99.7%
div-sub99.7%
sub-neg99.7%
*-inverses99.7%
metadata-eval99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.9%
sub-neg66.9%
associate-*r/66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
if -7.5000000000000003e-28 < z Initial program 91.5%
+-commutative91.5%
remove-double-neg91.5%
distribute-frac-neg91.5%
unsub-neg91.5%
*-commutative91.5%
associate-*r*91.5%
distribute-rgt1-in91.5%
associate-/l*91.4%
fma-neg91.4%
*-commutative91.4%
fma-define91.4%
*-commutative91.4%
distribute-frac-neg91.4%
remove-double-neg91.4%
Simplified91.4%
Taylor expanded in t around inf 98.8%
associate--l+98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
+-commutative98.8%
associate-*r/98.8%
distribute-lft-in98.8%
metadata-eval98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in z around 0 46.0%
associate-/r*45.9%
Simplified45.9%
Final simplification52.2%
(FPCore (x y z t) :precision binary64 (if (<= z -2.6e-27) (+ -2.0 (/ 2.0 t)) (/ (/ 2.0 z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e-27) {
tmp = -2.0 + (2.0 / t);
} 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 <= (-2.6d-27)) then
tmp = (-2.0d0) + (2.0d0 / t)
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 <= -2.6e-27) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (2.0 / z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.6e-27: tmp = -2.0 + (2.0 / t) else: tmp = (2.0 / z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.6e-27) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(Float64(2.0 / z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.6e-27) tmp = -2.0 + (2.0 / t); else tmp = (2.0 / z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.6e-27], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-27}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\end{array}
\end{array}
if z < -2.60000000000000017e-27Initial program 79.0%
Taylor expanded in z around inf 99.7%
div-sub99.7%
sub-neg99.7%
*-inverses99.7%
metadata-eval99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.9%
sub-neg66.9%
associate-*r/66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
if -2.60000000000000017e-27 < z Initial program 91.5%
Taylor expanded in t around 0 57.0%
associate-*r/57.0%
metadata-eval57.0%
Simplified57.0%
Taylor expanded in z around 0 45.9%
Final simplification52.2%
(FPCore (x y z t) :precision binary64 (if (<= t -7500000.0) -2.0 (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7500000.0) {
tmp = -2.0;
} else {
tmp = 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 (t <= (-7500000.0d0)) then
tmp = -2.0d0
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7500000.0) {
tmp = -2.0;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7500000.0: tmp = -2.0 else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7500000.0) tmp = -2.0; else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -7500000.0) tmp = -2.0; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7500000.0], -2.0, N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7500000:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if t < -7.5e6Initial program 74.5%
+-commutative74.5%
remove-double-neg74.5%
distribute-frac-neg74.5%
unsub-neg74.5%
*-commutative74.5%
associate-*r*74.5%
distribute-rgt1-in74.5%
associate-/l*74.5%
fma-neg74.5%
*-commutative74.5%
fma-define74.5%
*-commutative74.5%
distribute-frac-neg74.5%
remove-double-neg74.5%
Simplified74.5%
Taylor expanded in t around inf 100.0%
associate--l+100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 57.3%
sub-neg57.3%
metadata-eval57.3%
+-commutative57.3%
associate-/r*57.3%
associate-*r/57.3%
associate-*l/57.4%
distribute-rgt-in57.4%
associate-*l/57.4%
*-lft-identity57.4%
Simplified57.4%
Taylor expanded in z around 0 57.2%
Taylor expanded in z around inf 42.7%
if -7.5e6 < t Initial program 91.3%
Taylor expanded in t around 0 61.8%
associate-*r/61.8%
metadata-eval61.8%
Simplified61.8%
Taylor expanded in z around inf 27.2%
Final simplification30.5%
(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 87.7%
+-commutative87.7%
remove-double-neg87.7%
distribute-frac-neg87.7%
unsub-neg87.7%
*-commutative87.7%
associate-*r*87.7%
distribute-rgt1-in87.7%
associate-/l*87.6%
fma-neg87.6%
*-commutative87.6%
fma-define87.6%
*-commutative87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
Simplified87.6%
Taylor expanded in t around inf 99.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 71.0%
sub-neg71.0%
metadata-eval71.0%
+-commutative71.0%
associate-/r*71.0%
associate-*r/71.0%
associate-*l/71.0%
distribute-rgt-in71.0%
associate-*l/71.0%
*-lft-identity71.0%
Simplified71.0%
Taylor expanded in z around 0 50.1%
Taylor expanded in z around inf 19.7%
Final simplification19.7%
(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 2024066
(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))))