
(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 21 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 (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t))))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + 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]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
*-commutative99.9%
*-un-lft-identity99.9%
distribute-rgt-out--99.9%
*-commutative99.9%
add-sqr-sqrt49.5%
associate-*r*49.5%
Applied egg-rr49.5%
associate-*l*49.5%
add-sqr-sqrt99.9%
flip--99.9%
associate-*l/99.9%
metadata-eval99.9%
pow299.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (fma (+ a -0.5) b (+ x (+ y (pow (/ 1.0 (* z (- 1.0 (log t)))) -1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + pow((1.0 / (z * (1.0 - log(t)))), -1.0))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + (Float64(1.0 / Float64(z * Float64(1.0 - log(t)))) ^ -1.0)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + N[Power[N[(1.0 / N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + {\left(\frac{1}{z \cdot \left(1 - \log t\right)}\right)}^{-1}\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
*-commutative99.9%
*-un-lft-identity99.9%
distribute-rgt-out--99.9%
*-commutative99.9%
add-sqr-sqrt49.5%
associate-*r*49.5%
Applied egg-rr49.5%
associate-*l*49.5%
add-sqr-sqrt99.9%
flip--99.9%
associate-*l/99.9%
metadata-eval99.9%
pow299.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.9%
+-commutative99.9%
Simplified99.9%
clear-num99.8%
inv-pow99.8%
clear-num99.9%
associate-/r/99.9%
metadata-eval99.9%
unpow299.9%
flip--99.9%
*-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(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.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (fma (+ a -0.5) b (+ x (+ y (- z (* (log t) z))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + (z - (log(t) * z)))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(z - Float64(log(t) * z))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - \log t \cdot z\right)\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e+72) (not (<= t_1 2e+74)))
(+ (+ x y) t_1)
(+ x (+ y (* z (- 1.0 (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 <= -1e+72) || !(t_1 <= 2e+74)) {
tmp = (x + y) + t_1;
} else {
tmp = x + (y + (z * (1.0 - 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 <= (-1d+72)) .or. (.not. (t_1 <= 2d+74))) then
tmp = (x + y) + t_1
else
tmp = x + (y + (z * (1.0d0 - 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 <= -1e+72) || !(t_1 <= 2e+74)) {
tmp = (x + y) + t_1;
} else {
tmp = x + (y + (z * (1.0 - Math.log(t))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+72) or not (t_1 <= 2e+74): tmp = (x + y) + t_1 else: tmp = x + (y + (z * (1.0 - 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 <= -1e+72) || !(t_1 <= 2e+74)) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(x + Float64(y + Float64(z * Float64(1.0 - 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 <= -1e+72) || ~((t_1 <= 2e+74))) tmp = (x + y) + t_1; else tmp = x + (y + (z * (1.0 - 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, -1e+72], N[Not[LessEqual[t$95$1, 2e+74]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+72} \lor \neg \left(t_1 \leq 2 \cdot 10^{+74}\right):\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -9.99999999999999944e71 or 1.9999999999999999e74 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in z around 0 92.4%
if -9.99999999999999944e71 < (*.f64 (-.f64 a 1/2) b) < 1.9999999999999999e74Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 94.8%
Final simplification93.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -5e+62) (- (+ x (+ z (* a b))) (* (log t) z)) (+ (* b (- a 0.5)) (+ y (* z (- 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e+62) {
tmp = (x + (z + (a * b))) - (log(t) * z);
} else {
tmp = (b * (a - 0.5)) + (y + (z * (1.0 - 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) :: tmp
if ((x + y) <= (-5d+62)) then
tmp = (x + (z + (a * b))) - (log(t) * z)
else
tmp = (b * (a - 0.5d0)) + (y + (z * (1.0d0 - 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 tmp;
if ((x + y) <= -5e+62) {
tmp = (x + (z + (a * b))) - (Math.log(t) * z);
} else {
tmp = (b * (a - 0.5)) + (y + (z * (1.0 - Math.log(t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -5e+62: tmp = (x + (z + (a * b))) - (math.log(t) * z) else: tmp = (b * (a - 0.5)) + (y + (z * (1.0 - math.log(t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -5e+62) tmp = Float64(Float64(x + Float64(z + Float64(a * b))) - Float64(log(t) * z)); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(y + Float64(z * Float64(1.0 - log(t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -5e+62) tmp = (x + (z + (a * b))) - (log(t) * z); else tmp = (b * (a - 0.5)) + (y + (z * (1.0 - log(t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e+62], N[(N[(x + N[(z + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+62}:\\
\;\;\;\;\left(x + \left(z + a \cdot b\right)\right) - \log t \cdot z\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -5.00000000000000029e62Initial program 99.9%
Taylor expanded in y around 0 64.3%
Taylor expanded in a around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -5.00000000000000029e62 < (+.f64 x y) Initial program 99.9%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 79.1%
pow-base-179.1%
*-commutative79.1%
*-lft-identity79.1%
associate-+r-79.1%
sub-neg79.1%
distribute-lft-neg-in79.1%
*-lft-identity79.1%
log-rec79.1%
distribute-rgt-in79.1%
log-rec79.1%
sub-neg79.1%
Simplified79.1%
Final simplification70.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) -2e-188)
(- (+ x (+ z t_1)) (* (log t) z))
(+ t_1 (+ y (* z (- 1.0 (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 ((x + y) <= -2e-188) {
tmp = (x + (z + t_1)) - (log(t) * z);
} else {
tmp = t_1 + (y + (z * (1.0 - 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 ((x + y) <= (-2d-188)) then
tmp = (x + (z + t_1)) - (log(t) * z)
else
tmp = t_1 + (y + (z * (1.0d0 - 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 ((x + y) <= -2e-188) {
tmp = (x + (z + t_1)) - (Math.log(t) * z);
} else {
tmp = t_1 + (y + (z * (1.0 - Math.log(t))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -2e-188: tmp = (x + (z + t_1)) - (math.log(t) * z) else: tmp = t_1 + (y + (z * (1.0 - 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 (Float64(x + y) <= -2e-188) tmp = Float64(Float64(x + Float64(z + t_1)) - Float64(log(t) * z)); else tmp = Float64(t_1 + Float64(y + Float64(z * Float64(1.0 - 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 ((x + y) <= -2e-188) tmp = (x + (z + t_1)) - (log(t) * z); else tmp = t_1 + (y + (z * (1.0 - 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[LessEqual[N[(x + y), $MachinePrecision], -2e-188], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{-188}:\\
\;\;\;\;\left(x + \left(z + t_1\right)\right) - \log t \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -1.9999999999999999e-188Initial program 99.9%
Taylor expanded in y around 0 74.2%
if -1.9999999999999999e-188 < (+.f64 x y) Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 73.2%
pow-base-173.2%
*-commutative73.2%
*-lft-identity73.2%
associate-+r-73.2%
sub-neg73.2%
distribute-lft-neg-in73.2%
*-lft-identity73.2%
log-rec73.2%
distribute-rgt-in73.3%
log-rec73.3%
sub-neg73.3%
Simplified73.3%
Final simplification73.8%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* (log t) z)) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (log(t) * z)) + (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)) - (log(t) * z)) + (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)) - (Math.log(t) * z)) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (math.log(t) * z)) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(log(t) * z)) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (log(t) * z)) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - \log t \cdot z\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (- (+ (* (+ a -0.5) b) (+ x (+ y z))) (* (log t) z)))
double code(double x, double y, double z, double t, double a, double b) {
return (((a + -0.5) * b) + (x + (y + z))) - (log(t) * z);
}
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 = (((a + (-0.5d0)) * b) + (x + (y + z))) - (log(t) * z)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((a + -0.5) * b) + (x + (y + z))) - (Math.log(t) * z);
}
def code(x, y, z, t, a, b): return (((a + -0.5) * b) + (x + (y + z))) - (math.log(t) * z)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(a + -0.5) * b) + Float64(x + Float64(y + z))) - Float64(log(t) * z)) end
function tmp = code(x, y, z, t, a, b) tmp = (((a + -0.5) * b) + (x + (y + z))) - (log(t) * z); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision] + N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(a + -0.5\right) \cdot b + \left(x + \left(y + z\right)\right)\right) - \log t \cdot z
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-udef99.9%
metadata-eval99.9%
sub-neg99.9%
distribute-rgt-out--99.9%
*-un-lft-identity99.9%
*-commutative99.9%
associate-+r+99.9%
associate--l+99.9%
associate-+r-99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.95e+285) (* z (- 1.0 (log t))) (if (<= z 3.2e+91) (+ (+ x y) (* b (- a 0.5))) (+ x (- z (* (log t) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+285) {
tmp = z * (1.0 - log(t));
} else if (z <= 3.2e+91) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = x + (z - (log(t) * z));
}
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.95d+285)) then
tmp = z * (1.0d0 - log(t))
else if (z <= 3.2d+91) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = x + (z - (log(t) * z))
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.95e+285) {
tmp = z * (1.0 - Math.log(t));
} else if (z <= 3.2e+91) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = x + (z - (Math.log(t) * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.95e+285: tmp = z * (1.0 - math.log(t)) elif z <= 3.2e+91: tmp = (x + y) + (b * (a - 0.5)) else: tmp = x + (z - (math.log(t) * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.95e+285) tmp = Float64(z * Float64(1.0 - log(t))); elseif (z <= 3.2e+91) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + Float64(z - Float64(log(t) * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.95e+285) tmp = z * (1.0 - log(t)); elseif (z <= 3.2e+91) tmp = (x + y) + (b * (a - 0.5)); else tmp = x + (z - (log(t) * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.95e+285], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+91], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+285}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+91}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - \log t \cdot z\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e285Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.2%
+-commutative99.2%
*-lft-identity99.2%
metadata-eval99.2%
*-commutative99.2%
distribute-rgt-out--99.2%
metadata-eval99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
*-commutative99.2%
fma-def99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 99.2%
if -1.9499999999999999e285 < z < 3.19999999999999989e91Initial program 99.9%
Taylor expanded in z around 0 88.0%
if 3.19999999999999989e91 < z Initial program 99.8%
Taylor expanded in y around 0 83.5%
Taylor expanded in b around 0 71.0%
associate--l+71.0%
Simplified71.0%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.95e+285) (* z (- 1.0 (log t))) (if (<= z 1.7e+91) (+ y (fma b (+ a -0.5) x)) (+ x (- z (* (log t) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+285) {
tmp = z * (1.0 - log(t));
} else if (z <= 1.7e+91) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = x + (z - (log(t) * z));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.95e+285) tmp = Float64(z * Float64(1.0 - log(t))); elseif (z <= 1.7e+91) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = Float64(x + Float64(z - Float64(log(t) * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.95e+285], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+91], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+285}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+91}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - \log t \cdot z\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e285Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.2%
+-commutative99.2%
*-lft-identity99.2%
metadata-eval99.2%
*-commutative99.2%
distribute-rgt-out--99.2%
metadata-eval99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
*-commutative99.2%
fma-def99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 99.2%
if -1.9499999999999999e285 < z < 1.7e91Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 88.0%
+-commutative88.0%
sub-neg88.0%
metadata-eval88.0%
*-commutative88.0%
associate-+l+88.0%
*-commutative88.0%
fma-def88.0%
Simplified88.0%
if 1.7e91 < z Initial program 99.8%
Taylor expanded in y around 0 83.5%
Taylor expanded in b around 0 71.0%
associate--l+71.0%
Simplified71.0%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.95e+285) (not (<= z 2.3e+214))) (* z (- 1.0 (log t))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.95e+285) || !(z <= 2.3e+214)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
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.95d+285)) .or. (.not. (z <= 2.3d+214))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (x + y) + (b * (a - 0.5d0))
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.95e+285) || !(z <= 2.3e+214)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.95e+285) or not (z <= 2.3e+214): tmp = z * (1.0 - math.log(t)) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.95e+285) || !(z <= 2.3e+214)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.95e+285) || ~((z <= 2.3e+214))) tmp = z * (1.0 - log(t)); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.95e+285], N[Not[LessEqual[z, 2.3e+214]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+285} \lor \neg \left(z \leq 2.3 \cdot 10^{+214}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e285 or 2.2999999999999999e214 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
*-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 85.5%
if -1.9499999999999999e285 < z < 2.2999999999999999e214Initial program 99.9%
Taylor expanded in z around 0 84.3%
Final simplification84.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= (+ x y) -5e+50)
(+ x y)
(if (<= (+ x y) -5e-190)
(* a b)
(if (<= (+ x y) 5e+53)
(* -0.5 b)
(if (<= (+ x y) 5e+70) (* a b) (+ x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e+50) {
tmp = x + y;
} else if ((x + y) <= -5e-190) {
tmp = a * b;
} else if ((x + y) <= 5e+53) {
tmp = -0.5 * b;
} else if ((x + y) <= 5e+70) {
tmp = a * 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 ((x + y) <= (-5d+50)) then
tmp = x + y
else if ((x + y) <= (-5d-190)) then
tmp = a * b
else if ((x + y) <= 5d+53) then
tmp = (-0.5d0) * b
else if ((x + y) <= 5d+70) then
tmp = a * 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 ((x + y) <= -5e+50) {
tmp = x + y;
} else if ((x + y) <= -5e-190) {
tmp = a * b;
} else if ((x + y) <= 5e+53) {
tmp = -0.5 * b;
} else if ((x + y) <= 5e+70) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -5e+50: tmp = x + y elif (x + y) <= -5e-190: tmp = a * b elif (x + y) <= 5e+53: tmp = -0.5 * b elif (x + y) <= 5e+70: tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -5e+50) tmp = Float64(x + y); elseif (Float64(x + y) <= -5e-190) tmp = Float64(a * b); elseif (Float64(x + y) <= 5e+53) tmp = Float64(-0.5 * b); elseif (Float64(x + y) <= 5e+70) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -5e+50) tmp = x + y; elseif ((x + y) <= -5e-190) tmp = a * b; elseif ((x + y) <= 5e+53) tmp = -0.5 * b; elseif ((x + y) <= 5e+70) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e+50], N[(x + y), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], -5e-190], N[(a * b), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5e+53], N[(-0.5 * b), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5e+70], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+50}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq -5 \cdot 10^{-190}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+53}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+70}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -5e50 or 5.0000000000000002e70 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 82.1%
+-commutative82.1%
sub-neg82.1%
metadata-eval82.1%
*-commutative82.1%
associate-+l+82.1%
*-commutative82.1%
fma-def82.1%
Simplified82.1%
Taylor expanded in b around 0 62.5%
if -5e50 < (+.f64 x y) < -5.00000000000000034e-190 or 5.0000000000000004e53 < (+.f64 x y) < 5.0000000000000002e70Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 58.8%
*-commutative58.8%
Simplified58.8%
if -5.00000000000000034e-190 < (+.f64 x y) < 5.0000000000000004e53Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around inf 40.2%
Taylor expanded in a around 0 27.3%
Final simplification56.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (+ x y) -5e+62) (not (<= (+ x y) 5e+80))) (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x + y) <= -5e+62) || !((x + y) <= 5e+80)) {
tmp = x + y;
} else {
tmp = b * (a - 0.5);
}
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 (((x + y) <= (-5d+62)) .or. (.not. ((x + y) <= 5d+80))) then
tmp = x + y
else
tmp = b * (a - 0.5d0)
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 (((x + y) <= -5e+62) || !((x + y) <= 5e+80)) {
tmp = x + y;
} else {
tmp = b * (a - 0.5);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((x + y) <= -5e+62) or not ((x + y) <= 5e+80): tmp = x + y else: tmp = b * (a - 0.5) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(x + y) <= -5e+62) || !(Float64(x + y) <= 5e+80)) tmp = Float64(x + y); else tmp = Float64(b * Float64(a - 0.5)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((x + y) <= -5e+62) || ~(((x + y) <= 5e+80))) tmp = x + y; else tmp = b * (a - 0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(x + y), $MachinePrecision], -5e+62], N[Not[LessEqual[N[(x + y), $MachinePrecision], 5e+80]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+62} \lor \neg \left(x + y \leq 5 \cdot 10^{+80}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -5.00000000000000029e62 or 4.99999999999999961e80 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 83.4%
+-commutative83.4%
sub-neg83.4%
metadata-eval83.4%
*-commutative83.4%
associate-+l+83.4%
*-commutative83.4%
fma-def83.4%
Simplified83.4%
Taylor expanded in b around 0 63.8%
if -5.00000000000000029e62 < (+.f64 x y) < 4.99999999999999961e80Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 56.6%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -5e+62) (+ x (* a b)) (if (<= (+ x y) 5e+80) (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e+62) {
tmp = x + (a * b);
} else if ((x + y) <= 5e+80) {
tmp = b * (a - 0.5);
} 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 ((x + y) <= (-5d+62)) then
tmp = x + (a * b)
else if ((x + y) <= 5d+80) then
tmp = b * (a - 0.5d0)
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 ((x + y) <= -5e+62) {
tmp = x + (a * b);
} else if ((x + y) <= 5e+80) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -5e+62: tmp = x + (a * b) elif (x + y) <= 5e+80: tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -5e+62) tmp = Float64(x + Float64(a * b)); elseif (Float64(x + y) <= 5e+80) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -5e+62) tmp = x + (a * b); elseif ((x + y) <= 5e+80) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e+62], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5e+80], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+62}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+80}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -5.00000000000000029e62Initial program 99.9%
Taylor expanded in y around 0 64.3%
Taylor expanded in a around inf 56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in z around 0 41.8%
if -5.00000000000000029e62 < (+.f64 x y) < 4.99999999999999961e80Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 56.6%
if 4.99999999999999961e80 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 81.2%
+-commutative81.2%
sub-neg81.2%
metadata-eval81.2%
*-commutative81.2%
associate-+l+81.2%
*-commutative81.2%
fma-def81.2%
Simplified81.2%
Taylor expanded in b around 0 67.3%
Final simplification54.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5e+80) (+ x (* b (- a 0.5))) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+80) {
tmp = x + (b * (a - 0.5));
} 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 ((x + y) <= 5d+80) then
tmp = x + (b * (a - 0.5d0))
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 ((x + y) <= 5e+80) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5e+80: tmp = x + (b * (a - 0.5)) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5e+80) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 5e+80) tmp = x + (b * (a - 0.5)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+80], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+80}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < 4.99999999999999961e80Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
sub-neg75.6%
metadata-eval75.6%
*-commutative75.6%
associate-+l+75.6%
*-commutative75.6%
fma-def75.6%
Simplified75.6%
Taylor expanded in y around 0 54.8%
if 4.99999999999999961e80 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 81.2%
+-commutative81.2%
sub-neg81.2%
metadata-eval81.2%
*-commutative81.2%
associate-+l+81.2%
*-commutative81.2%
fma-def81.2%
Simplified81.2%
Taylor expanded in b around 0 67.3%
Final simplification58.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 4e-83) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 4e-83) {
tmp = x + t_1;
} else {
tmp = y + 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 = b * (a - 0.5d0)
if ((x + y) <= 4d-83) then
tmp = x + t_1
else
tmp = y + 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 = b * (a - 0.5);
double tmp;
if ((x + y) <= 4e-83) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 4e-83: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= 4e-83) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= 4e-83) tmp = x + t_1; else tmp = y + t_1; 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[LessEqual[N[(x + y), $MachinePrecision], 4e-83], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 4 \cdot 10^{-83}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < 4.0000000000000001e-83Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 76.3%
+-commutative76.3%
sub-neg76.3%
metadata-eval76.3%
*-commutative76.3%
associate-+l+76.3%
*-commutative76.3%
fma-def76.3%
Simplified76.3%
Taylor expanded in y around 0 53.6%
if 4.0000000000000001e-83 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
sub-neg78.7%
metadata-eval78.7%
*-commutative78.7%
associate-+l+78.7%
*-commutative78.7%
fma-def78.7%
Simplified78.7%
Taylor expanded in x around 0 47.5%
Final simplification51.1%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (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 = (x + y) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0 77.3%
Final simplification77.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7e+50) x (if (<= x -3.3e-75) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7e+50) {
tmp = x;
} else if (x <= -3.3e-75) {
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 (x <= (-7d+50)) then
tmp = x
else if (x <= (-3.3d-75)) 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 (x <= -7e+50) {
tmp = x;
} else if (x <= -3.3e-75) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7e+50: tmp = x elif x <= -3.3e-75: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7e+50) tmp = x; elseif (x <= -3.3e-75) 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 (x <= -7e+50) tmp = x; elseif (x <= -3.3e-75) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7e+50], x, If[LessEqual[x, -3.3e-75], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-75}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -7.00000000000000012e50Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 44.2%
if -7.00000000000000012e50 < x < -3.3e-75Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 48.9%
*-commutative48.9%
Simplified48.9%
if -3.3e-75 < x Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 25.7%
Final simplification32.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.5e+50) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.5e+50) {
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 (x <= (-6.5d+50)) 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 (x <= -6.5e+50) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.5e+50: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.5e+50) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.5e+50) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.5e+50], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -6.5000000000000003e50Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 44.2%
if -6.5000000000000003e50 < x Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 24.1%
Final simplification28.5%
(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.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 24.1%
Final simplification24.1%
(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 2023321
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))