
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (+ a -0.5) b (+ x (+ y (- z (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + (z - (z * log(t))))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(z - Float64(z * log(t)))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
associate-+l+99.5%
Simplified99.5%
(FPCore (x y z t a b) :precision binary64 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -5e+90) (not (<= t_1 5e+71)))
(+ x (+ y (* (+ a -0.5) b)))
(- (+ x (+ y z)) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+90) || !(t_1 <= 5e+71)) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = (x + (y + z)) - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d+90)) .or. (.not. (t_1 <= 5d+71))) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else
tmp = (x + (y + z)) - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+90) || !(t_1 <= 5e+71)) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = (x + (y + z)) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+90) or not (t_1 <= 5e+71): tmp = x + (y + ((a + -0.5) * b)) else: tmp = (x + (y + z)) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -5e+90) || !(t_1 <= 5e+71)) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); else tmp = Float64(Float64(x + Float64(y + z)) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -5e+90) || ~((t_1 <= 5e+71))) tmp = x + (y + ((a + -0.5) * b)); else tmp = (x + (y + z)) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+90], N[Not[LessEqual[t$95$1, 5e+71]], $MachinePrecision]], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+90} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+71}\right):\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + \left(y + z\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e90 or 4.99999999999999972e71 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.1%
Taylor expanded in a around 0 99.1%
Taylor expanded in z around 0 94.8%
+-commutative94.8%
distribute-rgt-in94.8%
Simplified94.8%
if -5.0000000000000004e90 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999972e71Initial program 99.8%
Taylor expanded in b around 0 97.0%
Final simplification95.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.95e+118) (not (<= z 1.65e+156))) (+ (* z (- 1.0 (log t))) (* a b)) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.95e+118) || !(z <= 1.65e+156)) {
tmp = (z * (1.0 - log(t))) + (a * b);
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-3.95d+118)) .or. (.not. (z <= 1.65d+156))) then
tmp = (z * (1.0d0 - log(t))) + (a * b)
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.95e+118) || !(z <= 1.65e+156)) {
tmp = (z * (1.0 - Math.log(t))) + (a * b);
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.95e+118) or not (z <= 1.65e+156): tmp = (z * (1.0 - math.log(t))) + (a * b) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.95e+118) || !(z <= 1.65e+156)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(a * b)); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.95e+118) || ~((z <= 1.65e+156))) tmp = (z * (1.0 - log(t))) + (a * b); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.95e+118], N[Not[LessEqual[z, 1.65e+156]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.95 \cdot 10^{+118} \lor \neg \left(z \leq 1.65 \cdot 10^{+156}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -3.9500000000000002e118 or 1.6499999999999999e156 < z Initial program 98.4%
+-commutative98.4%
associate--l+98.4%
associate-+r+98.4%
+-commutative98.4%
*-lft-identity98.4%
metadata-eval98.4%
*-commutative98.4%
distribute-rgt-out--98.4%
metadata-eval98.4%
fma-define98.4%
sub-neg98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in a around inf 80.0%
*-commutative80.0%
Simplified80.0%
if -3.9500000000000002e118 < z < 1.6499999999999999e156Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 95.4%
+-commutative95.4%
distribute-rgt-in95.4%
Simplified95.4%
Final simplification90.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= y 7.5e+16)
(- (+ x (+ z (* b (- a 0.5)))) t_1)
(- (+ (+ y z) (* (+ a -0.5) b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double tmp;
if (y <= 7.5e+16) {
tmp = (x + (z + (b * (a - 0.5)))) - t_1;
} else {
tmp = ((y + z) + ((a + -0.5) * b)) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * log(t)
if (y <= 7.5d+16) then
tmp = (x + (z + (b * (a - 0.5d0)))) - t_1
else
tmp = ((y + z) + ((a + (-0.5d0)) * b)) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double tmp;
if (y <= 7.5e+16) {
tmp = (x + (z + (b * (a - 0.5)))) - t_1;
} else {
tmp = ((y + z) + ((a + -0.5) * b)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if y <= 7.5e+16: tmp = (x + (z + (b * (a - 0.5)))) - t_1 else: tmp = ((y + z) + ((a + -0.5) * b)) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (y <= 7.5e+16) tmp = Float64(Float64(x + Float64(z + Float64(b * Float64(a - 0.5)))) - t_1); else tmp = Float64(Float64(Float64(y + z) + Float64(Float64(a + -0.5) * b)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); tmp = 0.0; if (y <= 7.5e+16) tmp = (x + (z + (b * (a - 0.5)))) - t_1; else tmp = ((y + z) + ((a + -0.5) * b)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7.5e+16], N[(N[(x + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(y + z), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;y \leq 7.5 \cdot 10^{+16}:\\
\;\;\;\;\left(x + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y + z\right) + \left(a + -0.5\right) \cdot b\right) - t\_1\\
\end{array}
\end{array}
if y < 7.5e16Initial program 99.3%
Taylor expanded in y around 0 78.2%
if 7.5e16 < y Initial program 99.9%
Taylor expanded in x around 0 91.6%
associate-+r+91.6%
+-commutative91.6%
sub-neg91.6%
metadata-eval91.6%
+-commutative91.6%
Simplified91.6%
Final simplification81.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.65e+77) (- (+ x (+ z (* b (- a 0.5)))) (* z (log t))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.65e+77) {
tmp = (x + (z + (b * (a - 0.5)))) - (z * log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.65d+77) then
tmp = (x + (z + (b * (a - 0.5d0)))) - (z * log(t))
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.65e+77) {
tmp = (x + (z + (b * (a - 0.5)))) - (z * Math.log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.65e+77: tmp = (x + (z + (b * (a - 0.5)))) - (z * math.log(t)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.65e+77) tmp = Float64(Float64(x + Float64(z + Float64(b * Float64(a - 0.5)))) - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.65e+77) tmp = (x + (z + (b * (a - 0.5)))) - (z * log(t)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.65e+77], N[(N[(x + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{+77}:\\
\;\;\;\;\left(x + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if y < 1.6499999999999999e77Initial program 99.4%
Taylor expanded in y around 0 78.5%
if 1.6499999999999999e77 < y Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 94.3%
+-commutative94.3%
distribute-rgt-in94.3%
Simplified94.3%
Final simplification81.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4e+130) (not (<= z 1.1e+156))) (+ x (* z (- 1.0 (log t)))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4e+130) || !(z <= 1.1e+156)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-4d+130)) .or. (.not. (z <= 1.1d+156))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4e+130) || !(z <= 1.1e+156)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4e+130) or not (z <= 1.1e+156): tmp = x + (z * (1.0 - math.log(t))) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4e+130) || !(z <= 1.1e+156)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4e+130) || ~((z <= 1.1e+156))) tmp = x + (z * (1.0 - log(t))); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4e+130], N[Not[LessEqual[z, 1.1e+156]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+130} \lor \neg \left(z \leq 1.1 \cdot 10^{+156}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -4.0000000000000002e130 or 1.10000000000000002e156 < z Initial program 98.3%
+-commutative98.3%
associate--l+98.3%
associate-+r+98.3%
+-commutative98.3%
*-lft-identity98.3%
metadata-eval98.3%
*-commutative98.3%
distribute-rgt-out--98.3%
metadata-eval98.3%
fma-define98.3%
sub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in x around inf 63.1%
if -4.0000000000000002e130 < z < 1.10000000000000002e156Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 94.9%
+-commutative94.9%
distribute-rgt-in94.9%
Simplified94.9%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.22e+169) (- z (* z (log t))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.22e+169) {
tmp = z - (z * log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.22d+169)) then
tmp = z - (z * log(t))
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.22e+169) {
tmp = z - (z * Math.log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.22e+169: tmp = z - (z * math.log(t)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.22e+169) tmp = Float64(z - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.22e+169) tmp = z - (z * log(t)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.22e+169], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+169}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -1.22e169Initial program 96.8%
Taylor expanded in z around inf 87.0%
Taylor expanded in b around 0 70.3%
if -1.22e169 < z Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 86.9%
+-commutative86.9%
distribute-rgt-in86.9%
Simplified86.9%
Final simplification84.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.9e+166) (* z (- 1.0 (log t))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e+166) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.9d+166)) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + ((a + (-0.5d0)) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e+166) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.9e+166: tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.9e+166) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.9e+166) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.9e+166], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+166}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -2.9000000000000001e166Initial program 96.8%
+-commutative96.8%
associate--l+96.8%
associate-+r+96.8%
+-commutative96.8%
*-lft-identity96.8%
metadata-eval96.8%
*-commutative96.8%
distribute-rgt-out--96.7%
metadata-eval96.7%
fma-define96.7%
sub-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around inf 73.2%
Taylor expanded in z around inf 70.2%
if -2.9000000000000001e166 < z Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 86.9%
+-commutative86.9%
distribute-rgt-in86.9%
Simplified86.9%
Final simplification84.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.6e+111) (* a b) (if (<= b 1.45e+140) (+ x y) (if (<= b 4.5e+284) (* a b) (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.6e+111) {
tmp = a * b;
} else if (b <= 1.45e+140) {
tmp = x + y;
} else if (b <= 4.5e+284) {
tmp = a * b;
} else {
tmp = -0.5 * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-6.6d+111)) then
tmp = a * b
else if (b <= 1.45d+140) then
tmp = x + y
else if (b <= 4.5d+284) then
tmp = a * b
else
tmp = (-0.5d0) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.6e+111) {
tmp = a * b;
} else if (b <= 1.45e+140) {
tmp = x + y;
} else if (b <= 4.5e+284) {
tmp = a * b;
} else {
tmp = -0.5 * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6.6e+111: tmp = a * b elif b <= 1.45e+140: tmp = x + y elif b <= 4.5e+284: tmp = a * b else: tmp = -0.5 * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.6e+111) tmp = Float64(a * b); elseif (b <= 1.45e+140) tmp = Float64(x + y); elseif (b <= 4.5e+284) tmp = Float64(a * b); else tmp = Float64(-0.5 * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6.6e+111) tmp = a * b; elseif (b <= 1.45e+140) tmp = x + y; elseif (b <= 4.5e+284) tmp = a * b; else tmp = -0.5 * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.6e+111], N[(a * b), $MachinePrecision], If[LessEqual[b, 1.45e+140], N[(x + y), $MachinePrecision], If[LessEqual[b, 4.5e+284], N[(a * b), $MachinePrecision], N[(-0.5 * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{+111}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+284}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\end{array}
if b < -6.6000000000000002e111 or 1.4499999999999999e140 < b < 4.4999999999999998e284Initial program 98.5%
Taylor expanded in a around inf 65.8%
fma-define65.8%
associate-/l*67.2%
Simplified67.2%
Taylor expanded in a around inf 55.7%
if -6.6000000000000002e111 < b < 1.4499999999999999e140Initial program 99.9%
add-cube-cbrt98.6%
pow398.6%
associate-+l+98.6%
Applied egg-rr98.6%
Taylor expanded in z around 0 73.4%
Taylor expanded in b around 0 58.8%
+-commutative58.8%
Simplified58.8%
if 4.4999999999999998e284 < b Initial program 99.8%
Taylor expanded in b around inf 99.8%
associate--l+99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in b around inf 89.3%
Taylor expanded in a around 0 76.6%
*-commutative76.6%
Simplified76.6%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.2e-7) (not (<= a 0.5))) (+ x (+ y (* a b))) (+ (+ x y) (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.2e-7) || !(a <= 0.5)) {
tmp = x + (y + (a * b));
} else {
tmp = (x + y) + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-8.2d-7)) .or. (.not. (a <= 0.5d0))) then
tmp = x + (y + (a * b))
else
tmp = (x + y) + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.2e-7) || !(a <= 0.5)) {
tmp = x + (y + (a * b));
} else {
tmp = (x + y) + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.2e-7) or not (a <= 0.5): tmp = x + (y + (a * b)) else: tmp = (x + y) + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.2e-7) || !(a <= 0.5)) tmp = Float64(x + Float64(y + Float64(a * b))); else tmp = Float64(Float64(x + y) + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -8.2e-7) || ~((a <= 0.5))) tmp = x + (y + (a * b)); else tmp = (x + y) + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.2e-7], N[Not[LessEqual[a, 0.5]], $MachinePrecision]], N[(x + N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{-7} \lor \neg \left(a \leq 0.5\right):\\
\;\;\;\;x + \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\
\end{array}
\end{array}
if a < -8.1999999999999998e-7 or 0.5 < a Initial program 99.1%
add-cube-cbrt98.4%
pow398.4%
associate-+l+98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 84.4%
Taylor expanded in a around inf 84.0%
*-commutative84.0%
Simplified84.0%
if -8.1999999999999998e-7 < a < 0.5Initial program 99.8%
add-cube-cbrt98.8%
pow398.7%
associate-+l+98.7%
Applied egg-rr98.7%
Taylor expanded in z around 0 76.1%
Taylor expanded in a around 0 75.9%
associate-+r+75.9%
+-commutative75.9%
Simplified75.9%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.4e+105) (not (<= b 3e+89))) (* (+ a -0.5) b) (+ x (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.4e+105) || !(b <= 3e+89)) {
tmp = (a + -0.5) * b;
} else {
tmp = x + (y + (a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4.4d+105)) .or. (.not. (b <= 3d+89))) then
tmp = (a + (-0.5d0)) * b
else
tmp = x + (y + (a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.4e+105) || !(b <= 3e+89)) {
tmp = (a + -0.5) * b;
} else {
tmp = x + (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.4e+105) or not (b <= 3e+89): tmp = (a + -0.5) * b else: tmp = x + (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.4e+105) || !(b <= 3e+89)) tmp = Float64(Float64(a + -0.5) * b); else tmp = Float64(x + Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4.4e+105) || ~((b <= 3e+89))) tmp = (a + -0.5) * b; else tmp = x + (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.4e+105], N[Not[LessEqual[b, 3e+89]], $MachinePrecision]], N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision], N[(x + N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{+105} \lor \neg \left(b \leq 3 \cdot 10^{+89}\right):\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if b < -4.40000000000000014e105 or 3.00000000000000013e89 < b Initial program 98.8%
Taylor expanded in b around inf 98.7%
associate--l+98.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in b around inf 79.6%
if -4.40000000000000014e105 < b < 3.00000000000000013e89Initial program 99.9%
add-cube-cbrt98.6%
pow398.6%
associate-+l+98.6%
Applied egg-rr98.6%
Taylor expanded in z around 0 72.6%
Taylor expanded in a around inf 70.9%
*-commutative70.9%
Simplified70.9%
Final simplification74.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.06e+55) (not (<= b 1.6e+79))) (* (+ a -0.5) b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.06e+55) || !(b <= 1.6e+79)) {
tmp = (a + -0.5) * b;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.06d+55)) .or. (.not. (b <= 1.6d+79))) then
tmp = (a + (-0.5d0)) * b
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.06e+55) || !(b <= 1.6e+79)) {
tmp = (a + -0.5) * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.06e+55) or not (b <= 1.6e+79): tmp = (a + -0.5) * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.06e+55) || !(b <= 1.6e+79)) tmp = Float64(Float64(a + -0.5) * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.06e+55) || ~((b <= 1.6e+79))) tmp = (a + -0.5) * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.06e+55], N[Not[LessEqual[b, 1.6e+79]], $MachinePrecision]], N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.06 \cdot 10^{+55} \lor \neg \left(b \leq 1.6 \cdot 10^{+79}\right):\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -2.06e55 or 1.60000000000000001e79 < b Initial program 98.9%
Taylor expanded in b around inf 98.8%
associate--l+98.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in b around inf 78.4%
if -2.06e55 < b < 1.60000000000000001e79Initial program 99.9%
add-cube-cbrt98.6%
pow398.6%
associate-+l+98.6%
Applied egg-rr98.6%
Taylor expanded in z around 0 71.2%
Taylor expanded in b around 0 61.8%
+-commutative61.8%
Simplified61.8%
Final simplification68.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.5e-67) x (if (<= y 2.85e+143) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e-67) {
tmp = x;
} else if (y <= 2.85e+143) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.5d-67) then
tmp = x
else if (y <= 2.85d+143) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e-67) {
tmp = x;
} else if (y <= 2.85e+143) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.5e-67: tmp = x elif y <= 2.85e+143: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.5e-67) tmp = x; elseif (y <= 2.85e+143) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.5e-67) tmp = x; elseif (y <= 2.85e+143) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.5e-67], x, If[LessEqual[y, 2.85e+143], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{+143}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.50000000000000016e-67Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
associate-+r+99.3%
+-commutative99.3%
*-lft-identity99.3%
metadata-eval99.3%
*-commutative99.3%
distribute-rgt-out--99.3%
metadata-eval99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 43.9%
Taylor expanded in z around 0 22.4%
if 1.50000000000000016e-67 < y < 2.85000000000000011e143Initial program 99.9%
Taylor expanded in a around inf 59.7%
fma-define59.7%
associate-/l*59.5%
Simplified59.5%
Taylor expanded in a around inf 29.9%
if 2.85000000000000011e143 < y Initial program 100.0%
Taylor expanded in a around inf 58.6%
fma-define58.6%
associate-/l*58.6%
Simplified58.6%
Taylor expanded in y around inf 60.7%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* (+ a -0.5) b))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((a + -0.5) * b));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + (y + ((a + (-0.5d0)) * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((a + -0.5) * b));
}
def code(x, y, z, t, a, b): return x + (y + ((a + -0.5) * b))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((a + -0.5) * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(a + -0.5\right) \cdot b\right)
\end{array}
Initial program 99.5%
Taylor expanded in a around 0 99.5%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
distribute-rgt-in79.9%
Simplified79.9%
Final simplification79.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6e+29) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6e+29) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 6d+29) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6e+29) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6e+29: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6e+29) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6e+29) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6e+29], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 5.9999999999999998e29Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.4%
+-commutative99.4%
*-lft-identity99.4%
metadata-eval99.4%
*-commutative99.4%
distribute-rgt-out--99.4%
metadata-eval99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 42.9%
Taylor expanded in z around 0 20.8%
if 5.9999999999999998e29 < y Initial program 99.9%
Taylor expanded in a around inf 60.4%
fma-define60.4%
associate-/l*60.3%
Simplified60.3%
Taylor expanded in y around inf 48.1%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 37.5%
Taylor expanded in z around 0 18.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024177
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))