
(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 14 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 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
}
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 = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
}
def code(x, y, z, t, a, b, c, i): return (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x)))))))
(t_2 (* (log c) b)))
(if (<= t_1 -1e+306)
(* i y)
(if (<= t_1 -1e+225)
(+ (* (/ z y) y) (+ a t))
(if (<= t_1 5e+15)
(fma y i t_2)
(if (<= t_1 2e+302)
(+ t_2 (+ a t))
(+ (* i y) (/ (* (- t a) (+ a t)) (- t a)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double t_2 = log(c) * b;
double tmp;
if (t_1 <= -1e+306) {
tmp = i * y;
} else if (t_1 <= -1e+225) {
tmp = ((z / y) * y) + (a + t);
} else if (t_1 <= 5e+15) {
tmp = fma(y, i, t_2);
} else if (t_1 <= 2e+302) {
tmp = t_2 + (a + t);
} else {
tmp = (i * y) + (((t - a) * (a + t)) / (t - a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) t_2 = Float64(log(c) * b) tmp = 0.0 if (t_1 <= -1e+306) tmp = Float64(i * y); elseif (t_1 <= -1e+225) tmp = Float64(Float64(Float64(z / y) * y) + Float64(a + t)); elseif (t_1 <= 5e+15) tmp = fma(y, i, t_2); elseif (t_1 <= 2e+302) tmp = Float64(t_2 + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(Float64(Float64(t - a) * Float64(a + t)) / Float64(t - a))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -1e+225], N[(N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+15], N[(y * i + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 2e+302], N[(t$95$2 + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(N[(N[(t - a), $MachinePrecision] * N[(a + t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
t_2 := \log c \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+225}:\\
\;\;\;\;\frac{z}{y} \cdot y + \left(a + t\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(y, i, t\_2\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;t\_2 + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \frac{\left(t - a\right) \cdot \left(a + t\right)}{t - a}\\
\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)) < -1.00000000000000002e306Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
if -1.00000000000000002e306 < (+.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.99999999999999928e224Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6480.9
Applied rewrites80.9%
Taylor expanded in y around inf
Applied rewrites60.6%
Taylor expanded in z around inf
Applied rewrites49.2%
if -9.99999999999999928e224 < (+.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)) < 5e15Initial program 99.9%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6442.8
Applied rewrites42.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6442.8
Applied rewrites42.8%
if 5e15 < (+.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)) < 2.0000000000000002e302Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6482.6
Applied rewrites82.6%
Taylor expanded in b around inf
Applied rewrites53.9%
if 2.0000000000000002e302 < (+.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.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.3
Applied rewrites90.3%
Taylor expanded in y around inf
Applied rewrites90.3%
Applied rewrites74.4%
Final simplification55.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z t_1))))))
(t_3 (+ t_1 (* i y))))
(if (<= t_2 -4e+303)
t_3
(if (<= t_2 100.0)
(+ (fma -0.5 (log c) z) (+ a t))
(if (<= t_2 2e+302) (+ (* (log c) b) (+ a t)) t_3)))))
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 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
double t_3 = t_1 + (i * y);
double tmp;
if (t_2 <= -4e+303) {
tmp = t_3;
} else if (t_2 <= 100.0) {
tmp = fma(-0.5, log(c), z) + (a + t);
} else if (t_2 <= 2e+302) {
tmp = (log(c) * b) + (a + t);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + t_1))))) t_3 = Float64(t_1 + Float64(i * y)) tmp = 0.0 if (t_2 <= -4e+303) tmp = t_3; elseif (t_2 <= 100.0) tmp = Float64(fma(-0.5, log(c), z) + Float64(a + t)); elseif (t_2 <= 2e+302) tmp = Float64(Float64(log(c) * b) + Float64(a + t)); else tmp = t_3; 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[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+303], t$95$3, If[LessEqual[t$95$2, 100.0], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+302], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + t\_1\right)\right)\right)\right)\\
t_3 := t\_1 + i \cdot y\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+303}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 100:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, z\right) + \left(a + t\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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)) < -4e303 or 2.0000000000000002e302 < (+.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 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6497.7
Applied rewrites97.7%
if -4e303 < (+.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.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.6
Applied rewrites87.6%
Taylor expanded in b around 0
Applied rewrites73.6%
Taylor expanded in y around 0
Applied rewrites54.4%
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)) < 2.0000000000000002e302Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6481.7
Applied rewrites81.7%
Taylor expanded in b around inf
Applied rewrites53.3%
Final simplification61.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -1e+306)
(* i y)
(if (<= t_1 100.0)
(+ (fma -0.5 (log c) z) (+ a t))
(if (<= t_1 2e+302)
(+ (* (log c) b) (+ a t))
(+ (* i y) (/ (* (- t a) (+ a t)) (- t a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -1e+306) {
tmp = i * y;
} else if (t_1 <= 100.0) {
tmp = fma(-0.5, log(c), z) + (a + t);
} else if (t_1 <= 2e+302) {
tmp = (log(c) * b) + (a + t);
} else {
tmp = (i * y) + (((t - a) * (a + t)) / (t - a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -1e+306) tmp = Float64(i * y); elseif (t_1 <= 100.0) tmp = Float64(fma(-0.5, log(c), z) + Float64(a + t)); elseif (t_1 <= 2e+302) tmp = Float64(Float64(log(c) * b) + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(Float64(Float64(t - a) * Float64(a + t)) / Float64(t - a))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+306], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 100.0], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+302], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(N[(N[(t - a), $MachinePrecision] * N[(a + t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+306}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq 100:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, z\right) + \left(a + t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \frac{\left(t - a\right) \cdot \left(a + t\right)}{t - a}\\
\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)) < -1.00000000000000002e306Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
if -1.00000000000000002e306 < (+.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.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.6
Applied rewrites85.6%
Taylor expanded in b around 0
Applied rewrites72.1%
Taylor expanded in y around 0
Applied rewrites53.5%
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)) < 2.0000000000000002e302Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6481.7
Applied rewrites81.7%
Taylor expanded in b around inf
Applied rewrites53.3%
if 2.0000000000000002e302 < (+.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.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.3
Applied rewrites90.3%
Taylor expanded in y around inf
Applied rewrites90.3%
Applied rewrites74.4%
Final simplification58.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z t_1))))))
(t_3 (+ t_1 (* i y))))
(if (<= t_2 -4e+303)
t_3
(if (<= t_2 2e+302) (+ (fma (- b 0.5) (log c) z) (+ a t)) t_3))))
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 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
double t_3 = t_1 + (i * y);
double tmp;
if (t_2 <= -4e+303) {
tmp = t_3;
} else if (t_2 <= 2e+302) {
tmp = fma((b - 0.5), log(c), z) + (a + t);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + t_1))))) t_3 = Float64(t_1 + Float64(i * y)) tmp = 0.0 if (t_2 <= -4e+303) tmp = t_3; elseif (t_2 <= 2e+302) tmp = Float64(fma(Float64(b - 0.5), log(c), z) + Float64(a + t)); else tmp = t_3; 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[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+303], t$95$3, If[LessEqual[t$95$2, 2e+302], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + t\_1\right)\right)\right)\right)\\
t_3 := t\_1 + i \cdot y\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+303}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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)) < -4e303 or 2.0000000000000002e302 < (+.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 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6497.7
Applied rewrites97.7%
if -4e303 < (+.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)) < 2.0000000000000002e302Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.0
Applied rewrites85.0%
Taylor expanded in y around 0
Applied rewrites70.3%
Final simplification75.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (fma (- b 0.5) (log c) (fma (log y) x z)) (+ a t))))
(if (<= x -2.05e+226)
t_1
(if (<= x 2.4e+151)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma((b - 0.5), log(c), fma(log(y), x, z)) + (a + t);
double tmp;
if (x <= -2.05e+226) {
tmp = t_1;
} else if (x <= 2.4e+151) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(a + t)) tmp = 0.0 if (x <= -2.05e+226) tmp = t_1; elseif (x <= 2.4e+151) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e+226], t$95$1, If[LessEqual[x, 2.4e+151], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.04999999999999993e226 or 2.4000000000000001e151 < x Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6487.3
Applied rewrites87.3%
if -2.04999999999999993e226 < x < 2.4000000000000001e151Initial program 100.0%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
Final simplification94.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -4.4e+243)
(+ (* (log y) x) (* i y))
(if (<= x 8e+222)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
(+ (fma (- b 0.5) (log c) (fma (log y) x t)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -4.4e+243) {
tmp = (log(y) * x) + (i * y);
} else if (x <= 8e+222) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = fma((b - 0.5), log(c), fma(log(y), x, t)) + a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -4.4e+243) tmp = Float64(Float64(log(y) * x) + Float64(i * y)); elseif (x <= 8e+222) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, t)) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -4.4e+243], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+222], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+243}:\\
\;\;\;\;\log y \cdot x + i \cdot y\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+222}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, t\right)\right) + a\\
\end{array}
\end{array}
if x < -4.40000000000000018e243Initial program 99.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6490.3
Applied rewrites90.3%
if -4.40000000000000018e243 < x < 8.0000000000000004e222Initial program 100.0%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6493.4
Applied rewrites93.4%
if 8.0000000000000004e222 < x Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6494.9
Applied rewrites94.9%
Taylor expanded in z around 0
Applied rewrites90.5%
Final simplification93.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (log y) x) (* i y))))
(if (<= x -4.4e+243)
t_1
(if (<= x 1.35e+237)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (log(y) * x) + (i * y);
double tmp;
if (x <= -4.4e+243) {
tmp = t_1;
} else if (x <= 1.35e+237) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(log(y) * x) + Float64(i * y)) tmp = 0.0 if (x <= -4.4e+243) tmp = t_1; elseif (x <= 1.35e+237) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+243], t$95$1, If[LessEqual[x, 1.35e+237], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x + i \cdot y\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+237}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.40000000000000018e243 or 1.35e237 < x Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6492.3
Applied rewrites92.3%
if -4.40000000000000018e243 < x < 1.35e237Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6493.1
Applied rewrites93.1%
Final simplification93.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 1.3e+33) (+ (fma (- b 0.5) (log c) z) (+ a t)) (+ (fma -0.5 (log c) (fma y i z)) (+ a t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.3e+33) {
tmp = fma((b - 0.5), log(c), z) + (a + t);
} else {
tmp = fma(-0.5, log(c), fma(y, i, z)) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.3e+33) tmp = Float64(fma(Float64(b - 0.5), log(c), z) + Float64(a + t)); else tmp = Float64(fma(-0.5, log(c), fma(y, i, z)) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.3e+33], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.3 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\end{array}
\end{array}
if y < 1.2999999999999999e33Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6482.2
Applied rewrites82.2%
Taylor expanded in y around 0
Applied rewrites76.9%
if 1.2999999999999999e33 < y Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.4
Applied rewrites89.4%
Taylor expanded in b around 0
Applied rewrites82.1%
Final simplification79.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y 1e-251)
(+ (* (log c) b) (+ a t))
(if (<= y 3.2e-227)
(* (log y) x)
(if (<= y 7.8e-59)
(fma (/ z a) a a)
(if (<= y 7.5e+30) (+ (* (/ z y) y) (+ a t)) (+ (* i y) (+ a t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1e-251) {
tmp = (log(c) * b) + (a + t);
} else if (y <= 3.2e-227) {
tmp = log(y) * x;
} else if (y <= 7.8e-59) {
tmp = fma((z / a), a, a);
} else if (y <= 7.5e+30) {
tmp = ((z / y) * y) + (a + t);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1e-251) tmp = Float64(Float64(log(c) * b) + Float64(a + t)); elseif (y <= 3.2e-227) tmp = Float64(log(y) * x); elseif (y <= 7.8e-59) tmp = fma(Float64(z / a), a, a); elseif (y <= 7.5e+30) tmp = Float64(Float64(Float64(z / y) * y) + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1e-251], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-227], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 7.8e-59], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision], If[LessEqual[y, 7.5e+30], N[(N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-251}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-227}:\\
\;\;\;\;\log y \cdot x\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-59}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{z}{y} \cdot y + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if y < 1.00000000000000002e-251Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6495.5
Applied rewrites95.5%
Taylor expanded in b around inf
Applied rewrites63.8%
if 1.00000000000000002e-251 < y < 3.2000000000000001e-227Initial program 99.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6461.0
Applied rewrites61.0%
if 3.2000000000000001e-227 < y < 7.80000000000000038e-59Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites72.5%
Taylor expanded in z around inf
Applied rewrites35.0%
if 7.80000000000000038e-59 < y < 7.49999999999999973e30Initial program 100.0%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.7
Applied rewrites85.7%
Taylor expanded in y around inf
Applied rewrites76.1%
Taylor expanded in z around inf
Applied rewrites55.3%
if 7.49999999999999973e30 < y Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.6
Applied rewrites89.6%
Taylor expanded in y around inf
Applied rewrites68.7%
Final simplification58.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 7.8e-59) (fma (/ z a) a a) (if (<= y 7.5e+30) (+ (* (/ z y) y) (+ a t)) (+ (* i y) (+ a t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 7.8e-59) {
tmp = fma((z / a), a, a);
} else if (y <= 7.5e+30) {
tmp = ((z / y) * y) + (a + t);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 7.8e-59) tmp = fma(Float64(z / a), a, a); elseif (y <= 7.5e+30) tmp = Float64(Float64(Float64(z / y) * y) + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 7.8e-59], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision], If[LessEqual[y, 7.5e+30], N[(N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.8 \cdot 10^{-59}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{z}{y} \cdot y + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if y < 7.80000000000000038e-59Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites70.6%
Taylor expanded in z around inf
Applied rewrites30.4%
if 7.80000000000000038e-59 < y < 7.49999999999999973e30Initial program 100.0%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.7
Applied rewrites85.7%
Taylor expanded in y around inf
Applied rewrites76.1%
Taylor expanded in z around inf
Applied rewrites55.3%
if 7.49999999999999973e30 < y Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.6
Applied rewrites89.6%
Taylor expanded in y around inf
Applied rewrites68.7%
Final simplification52.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2e+136) (fma (/ z a) a a) (+ (* i y) (+ a t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2e+136) {
tmp = fma((z / a), a, a);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2e+136) tmp = fma(Float64(z / a), a, a); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2e+136], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if z < -2.00000000000000012e136Initial program 100.0%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites66.0%
Taylor expanded in z around inf
Applied rewrites34.1%
if -2.00000000000000012e136 < z Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.1
Applied rewrites85.1%
Taylor expanded in y around inf
Applied rewrites58.4%
Final simplification54.0%
(FPCore (x y z t a b c i) :precision binary64 (+ (* i y) (+ a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
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 = (i * y) + (a + t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
def code(x, y, z, t, a, b, c, i): return (i * y) + (a + t)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(a + t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + (a + t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \left(a + t\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.7
Applied rewrites85.7%
Taylor expanded in y around inf
Applied rewrites53.7%
Final simplification53.7%
(FPCore (x y z t a b c i) :precision binary64 (* i y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
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 = i * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
def code(x, y, z, t, a, b, c, i): return i * y
function code(x, y, z, t, a, b, c, i) return Float64(i * y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = i * y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6427.8
Applied rewrites27.8%
Final simplification27.8%
herbie shell --seed 2024255
(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)))