
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (+ (fma (log y) x (+ (+ z t) (fma (+ b -0.5) (log c) a))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(log(y), x, ((z + t) + fma((b + -0.5), log(c), a))) + (y * i);
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(log(y), x, Float64(Float64(z + t) + fma(Float64(b + -0.5), log(c), a))) + Float64(y * i)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[Log[y], $MachinePrecision] * x + N[(N[(z + t), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right) + y \cdot i
\end{array}
Initial program 99.4%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.5
Applied rewrites99.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* y i) (+ (+ a (+ t (+ z t_1))) (* (log c) (- b 0.5))))))
(if (<= t_2 (- INFINITY))
(fma y i (* b (log c)))
(if (<= t_2 1e+29)
(+ a (fma (log c) (+ b -0.5) z))
(if (<= t_2 2e+295) (+ a t_1) (+ a (* y i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double t_2 = (y * i) + ((a + (t + (z + t_1))) + (log(c) * (b - 0.5)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(y, i, (b * log(c)));
} else if (t_2 <= 1e+29) {
tmp = a + fma(log(c), (b + -0.5), z);
} else if (t_2 <= 2e+295) {
tmp = a + t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + t_1))) + Float64(log(c) * Float64(b - 0.5)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(y, i, Float64(b * log(c))); elseif (t_2 <= 1e+29) tmp = Float64(a + fma(log(c), Float64(b + -0.5), z)); elseif (t_2 <= 2e+295) tmp = Float64(a + t_1); else tmp = Float64(a + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+29], N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+295], N[(a + t$95$1), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := y \cdot i + \left(\left(a + \left(t + \left(z + t\_1\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+29}:\\
\;\;\;\;a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+295}:\\
\;\;\;\;a + t\_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0Initial program 100.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f64100.0
Applied rewrites100.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
Applied rewrites100.0%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 9.99999999999999914e28Initial program 99.7%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6480.8
Applied rewrites80.8%
Taylor expanded in i around 0
Applied rewrites70.3%
Taylor expanded in x around 0
Applied rewrites49.2%
if 9.99999999999999914e28 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2e295Initial program 99.8%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6483.7
Applied rewrites83.7%
Taylor expanded in x around inf
Applied rewrites42.8%
if 2e295 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 97.1%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6491.4
Applied rewrites91.4%
Taylor expanded in i around inf
Applied rewrites71.6%
Final simplification52.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* y i) (+ (+ a (+ t (+ z t_1))) (* (log c) (- b 0.5))))))
(if (<= t_2 -5e+67)
(fma z (/ (* y i) z) z)
(if (<= t_2 1e+29)
(fma y i (* b (log c)))
(if (<= t_2 2e+295) (+ a t_1) (+ a (* y i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double t_2 = (y * i) + ((a + (t + (z + t_1))) + (log(c) * (b - 0.5)));
double tmp;
if (t_2 <= -5e+67) {
tmp = fma(z, ((y * i) / z), z);
} else if (t_2 <= 1e+29) {
tmp = fma(y, i, (b * log(c)));
} else if (t_2 <= 2e+295) {
tmp = a + t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + t_1))) + Float64(log(c) * Float64(b - 0.5)))) tmp = 0.0 if (t_2 <= -5e+67) tmp = fma(z, Float64(Float64(y * i) / z), z); elseif (t_2 <= 1e+29) tmp = fma(y, i, Float64(b * log(c))); elseif (t_2 <= 2e+295) tmp = Float64(a + t_1); else tmp = Float64(a + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+67], N[(z * N[(N[(y * i), $MachinePrecision] / z), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$2, 1e+29], N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+295], N[(a + t$95$1), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := y \cdot i + \left(\left(a + \left(t + \left(z + t\_1\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y \cdot i}{z}, z\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+295}:\\
\;\;\;\;a + t\_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -4.99999999999999976e67Initial program 99.8%
Taylor expanded in z around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
associate-*r*N/A
metadata-evalN/A
Applied rewrites69.8%
Taylor expanded in i around inf
Applied rewrites29.6%
if -4.99999999999999976e67 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 9.99999999999999914e28Initial program 99.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6461.8
Applied rewrites61.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6461.8
Applied rewrites61.8%
if 9.99999999999999914e28 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2e295Initial program 99.8%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6483.7
Applied rewrites83.7%
Taylor expanded in x around inf
Applied rewrites42.8%
if 2e295 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 97.1%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6491.4
Applied rewrites91.4%
Taylor expanded in i around inf
Applied rewrites71.6%
Final simplification41.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* y i) (+ (+ a (+ t (+ z t_1))) (* (log c) (- b 0.5))))))
(if (<= t_2 1e+29)
(fma z (/ (* y i) z) z)
(if (<= t_2 2e+295) (+ a t_1) (+ a (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double t_2 = (y * i) + ((a + (t + (z + t_1))) + (log(c) * (b - 0.5)));
double tmp;
if (t_2 <= 1e+29) {
tmp = fma(z, ((y * i) / z), z);
} else if (t_2 <= 2e+295) {
tmp = a + t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + t_1))) + Float64(log(c) * Float64(b - 0.5)))) tmp = 0.0 if (t_2 <= 1e+29) tmp = fma(z, Float64(Float64(y * i) / z), z); elseif (t_2 <= 2e+295) tmp = Float64(a + t_1); else tmp = Float64(a + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e+29], N[(z * N[(N[(y * i), $MachinePrecision] / z), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[t$95$2, 2e+295], N[(a + t$95$1), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := y \cdot i + \left(\left(a + \left(t + \left(z + t\_1\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;t\_2 \leq 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y \cdot i}{z}, z\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+295}:\\
\;\;\;\;a + t\_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 9.99999999999999914e28Initial program 99.8%
Taylor expanded in z around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
associate-*r*N/A
metadata-evalN/A
Applied rewrites71.4%
Taylor expanded in i around inf
Applied rewrites28.2%
if 9.99999999999999914e28 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2e295Initial program 99.8%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6483.7
Applied rewrites83.7%
Taylor expanded in x around inf
Applied rewrites42.8%
if 2e295 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 97.1%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6491.4
Applied rewrites91.4%
Taylor expanded in i around inf
Applied rewrites71.6%
Final simplification39.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* y i)
(+ (+ a (+ t (+ z (* (log y) x)))) (* (log c) (- b 0.5))))))
(if (<= t_1 (- INFINITY))
(* y i)
(if (<= t_1 100.0) (fma z (/ t z) z) (+ (+ t a) (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + ((a + (t + (z + (log(y) * x)))) + (log(c) * (b - 0.5)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * i;
} else if (t_1 <= 100.0) {
tmp = fma(z, (t / z), z);
} else {
tmp = (t + a) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))) + Float64(log(c) * Float64(b - 0.5)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * i); elseif (t_1 <= 100.0) tmp = fma(z, Float64(t / z), z); else tmp = Float64(Float64(t + a) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, 100.0], N[(z * N[(t / z), $MachinePrecision] + z), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \left(\left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq 100:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t}{z}, z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0Initial program 100.0%
Taylor expanded in y around inf
lower-*.f6487.9
Applied rewrites87.9%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 100Initial program 99.8%
Taylor expanded in z around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
associate-*r*N/A
metadata-evalN/A
Applied rewrites66.8%
Taylor expanded in t around inf
Applied rewrites28.6%
if 100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.1%
Taylor expanded in y around inf
lower-*.f6423.6
Applied rewrites23.6%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-+.f6482.2
Applied rewrites82.2%
Taylor expanded in y around inf
Applied rewrites52.8%
Final simplification45.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* y i)
(+ (+ a (+ t (+ z (* (log y) x)))) (* (log c) (- b 0.5))))))
(if (<= t_1 (- INFINITY))
(* y i)
(if (<= t_1 200.0) (fma z (/ a z) z) (+ (+ t a) (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + ((a + (t + (z + (log(y) * x)))) + (log(c) * (b - 0.5)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * i;
} else if (t_1 <= 200.0) {
tmp = fma(z, (a / z), z);
} else {
tmp = (t + a) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))) + Float64(log(c) * Float64(b - 0.5)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * i); elseif (t_1 <= 200.0) tmp = fma(z, Float64(a / z), z); else tmp = Float64(Float64(t + a) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, 200.0], N[(z * N[(a / z), $MachinePrecision] + z), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \left(\left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq 200:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{a}{z}, z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0Initial program 100.0%
Taylor expanded in y around inf
lower-*.f6487.9
Applied rewrites87.9%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 200Initial program 99.8%
Taylor expanded in z around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
associate-*r*N/A
metadata-evalN/A
Applied rewrites67.4%
Taylor expanded in a around inf
Applied rewrites21.3%
if 200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.1%
Taylor expanded in y around inf
lower-*.f6423.9
Applied rewrites23.9%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-+.f6481.9
Applied rewrites81.9%
Taylor expanded in y around inf
Applied rewrites53.5%
Final simplification42.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* y i) (+ (+ a (+ t (+ z (* (log y) x)))) (* (log c) (- b 0.5))))
-5e+29)
(fma z (/ (* y i) z) z)
(+ (+ t a) (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((y * i) + ((a + (t + (z + (log(y) * x)))) + (log(c) * (b - 0.5)))) <= -5e+29) {
tmp = fma(z, ((y * i) / z), z);
} else {
tmp = (t + a) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))) + Float64(log(c) * Float64(b - 0.5)))) <= -5e+29) tmp = fma(z, Float64(Float64(y * i) / z), z); else tmp = Float64(Float64(t + a) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e+29], N[(z * N[(N[(y * i), $MachinePrecision] / z), $MachinePrecision] + z), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot i + \left(\left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) \leq -5 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y \cdot i}{z}, z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + y \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -5.0000000000000001e29Initial program 99.8%
Taylor expanded in z around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
*-rgt-identityN/A
associate-*r*N/A
metadata-evalN/A
Applied rewrites70.8%
Taylor expanded in i around inf
Applied rewrites28.7%
if -5.0000000000000001e29 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.1%
Taylor expanded in y around inf
lower-*.f6423.5
Applied rewrites23.5%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-+.f6482.3
Applied rewrites82.3%
Taylor expanded in y around inf
Applied rewrites52.5%
Final simplification41.8%
(FPCore (x y z t a b c i) :precision binary64 (+ a (fma i y (fma (log c) (+ b -0.5) (fma x (log y) z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + fma(i, y, fma(log(c), (b + -0.5), fma(x, log(y), z)));
}
function code(x, y, z, t, a, b, c, i) return Float64(a + fma(i, y, fma(log(c), Float64(b + -0.5), fma(x, log(y), z)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \log y, z\right)\right)\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6484.5
Applied rewrites84.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (fma (log y) x (+ (+ z t) (- (- a)))))))
(if (<= x -1.15e+86)
t_1
(if (<= x 1.8e+168)
(+ (fma y i (fma (log c) (+ b -0.5) z)) (+ t a))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + fma(log(y), x, ((z + t) + -(-a)));
double tmp;
if (x <= -1.15e+86) {
tmp = t_1;
} else if (x <= 1.8e+168) {
tmp = fma(y, i, fma(log(c), (b + -0.5), z)) + (t + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + fma(log(y), x, Float64(Float64(z + t) + Float64(-Float64(-a))))) tmp = 0.0 if (x <= -1.15e+86) tmp = t_1; elseif (x <= 1.8e+168) tmp = Float64(fma(y, i, fma(log(c), Float64(b + -0.5), z)) + Float64(t + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[(N[(z + t), $MachinePrecision] + (-(-a))), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+86], t$95$1, If[LessEqual[x, 1.8e+168], N[(N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \mathsf{fma}\left(\log y, x, \left(z + t\right) + \left(-\left(-a\right)\right)\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right) + \left(t + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.14999999999999995e86 or 1.8e168 < x Initial program 99.7%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.8
Applied rewrites99.8%
Taylor expanded in a around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6491.9
Applied rewrites91.9%
Taylor expanded in a around inf
Applied rewrites95.3%
if -1.14999999999999995e86 < x < 1.8e168Initial program 99.3%
Taylor expanded in y around inf
lower-*.f6424.0
Applied rewrites24.0%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-+.f6497.3
Applied rewrites97.3%
Final simplification96.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* (log y) x))))
(if (<= x -4.1e+254)
t_1
(if (<= x 5.2e+211)
(+ (fma y i (fma (log c) (+ b -0.5) z)) (+ t a))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (log(y) * x);
double tmp;
if (x <= -4.1e+254) {
tmp = t_1;
} else if (x <= 5.2e+211) {
tmp = fma(y, i, fma(log(c), (b + -0.5), z)) + (t + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(log(y) * x)) tmp = 0.0 if (x <= -4.1e+254) tmp = t_1; elseif (x <= 5.2e+211) tmp = Float64(fma(y, i, fma(log(c), Float64(b + -0.5), z)) + Float64(t + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+254], t$95$1, If[LessEqual[x, 5.2e+211], N[(N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \log y \cdot x\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+211}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right) + \left(t + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.09999999999999987e254 or 5.1999999999999997e211 < x Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6490.4
Applied rewrites90.4%
if -4.09999999999999987e254 < x < 5.1999999999999997e211Initial program 99.4%
Taylor expanded in y around inf
lower-*.f6424.2
Applied rewrites24.2%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-+.f6492.7
Applied rewrites92.7%
Final simplification92.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* (log y) x))))
(if (<= x -4.1e+254)
t_1
(if (<= x 5.2e+211)
(+ a (+ (fma i y z) (fma (log c) (+ b -0.5) t)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (log(y) * x);
double tmp;
if (x <= -4.1e+254) {
tmp = t_1;
} else if (x <= 5.2e+211) {
tmp = a + (fma(i, y, z) + fma(log(c), (b + -0.5), t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(log(y) * x)) tmp = 0.0 if (x <= -4.1e+254) tmp = t_1; elseif (x <= 5.2e+211) tmp = Float64(a + Float64(fma(i, y, z) + fma(log(c), Float64(b + -0.5), t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+254], t$95$1, If[LessEqual[x, 5.2e+211], N[(a + N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \log y \cdot x\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+211}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.09999999999999987e254 or 5.1999999999999997e211 < x Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6490.4
Applied rewrites90.4%
if -4.09999999999999987e254 < x < 5.1999999999999997e211Initial program 99.4%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6492.7
Applied rewrites92.7%
Final simplification92.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* (log y) x))))
(if (<= x -4.1e+254)
t_1
(if (<= x 5.2e+211) (+ a (fma i y (fma (log c) (+ b -0.5) z))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (log(y) * x);
double tmp;
if (x <= -4.1e+254) {
tmp = t_1;
} else if (x <= 5.2e+211) {
tmp = a + fma(i, y, fma(log(c), (b + -0.5), z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(log(y) * x)) tmp = 0.0 if (x <= -4.1e+254) tmp = t_1; elseif (x <= 5.2e+211) tmp = Float64(a + fma(i, y, fma(log(c), Float64(b + -0.5), z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+254], t$95$1, If[LessEqual[x, 5.2e+211], N[(a + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \log y \cdot x\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+211}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.09999999999999987e254 or 5.1999999999999997e211 < x Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6490.4
Applied rewrites90.4%
if -4.09999999999999987e254 < x < 5.1999999999999997e211Initial program 99.4%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6482.8
Applied rewrites82.8%
Taylor expanded in x around 0
Applied rewrites76.2%
Final simplification78.2%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ t a) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + a) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (t + a) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + a) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (t + a) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(t + a) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (t + a) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(t + a\right) + y \cdot i
\end{array}
Initial program 99.4%
Taylor expanded in y around inf
lower-*.f6422.3
Applied rewrites22.3%
Taylor expanded in x around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-+.f6481.6
Applied rewrites81.6%
Taylor expanded in y around inf
Applied rewrites52.1%
Final simplification52.1%
(FPCore (x y z t a b c i) :precision binary64 (+ a (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = a + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (y * i);
}
def code(x, y, z, t, a, b, c, i): return a + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + y \cdot i
\end{array}
Initial program 99.4%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6484.5
Applied rewrites84.5%
Taylor expanded in i around inf
Applied rewrites38.1%
(FPCore (x y z t a b c i) :precision binary64 (* y i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return y * i;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = y * i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return y * i;
}
def code(x, y, z, t, a, b, c, i): return y * i
function code(x, y, z, t, a, b, c, i) return Float64(y * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = y * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i
\end{array}
Initial program 99.4%
Taylor expanded in y around inf
lower-*.f6422.3
Applied rewrites22.3%
Final simplification22.3%
herbie shell --seed 2024221
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
:precision binary64
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))