Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B

Percentage Accurate: 99.8% → 99.8%
Time: 13.5s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\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
 (+ (+ (+ (+ (+ (* 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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

\[\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
 (+ (+ (+ (+ (+ (* 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}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\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} \]
(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}
Derivation
  1. Initial program 99.9%

    \[\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 \]
  2. Add Preprocessing
  3. Final simplification99.9%

    \[\leadsto 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) \]
  4. Add Preprocessing

Alternative 2: 47.3% accurate, 0.4× speedup?

\[\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)\\ \mathbf{if}\;t\_2 \leq 1.5 \cdot 10^{+114}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\log c \cdot b + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, t\_1\right)\\ \end{array} \end{array} \]
(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)))))))
   (if (<= t_2 1.5e+114)
     (fma (* i y) 1.0 z)
     (if (<= t_2 5e+307) (+ (* (log c) b) (+ a t)) (fma y i 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;
	double t_2 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
	double tmp;
	if (t_2 <= 1.5e+114) {
		tmp = fma((i * y), 1.0, z);
	} else if (t_2 <= 5e+307) {
		tmp = (log(c) * b) + (a + t);
	} else {
		tmp = fma(y, i, t_1);
	}
	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)))))
	tmp = 0.0
	if (t_2 <= 1.5e+114)
		tmp = fma(Float64(i * y), 1.0, z);
	elseif (t_2 <= 5e+307)
		tmp = Float64(Float64(log(c) * b) + Float64(a + t));
	else
		tmp = fma(y, i, t_1);
	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]}, If[LessEqual[t$95$2, 1.5e+114], N[(N[(i * y), $MachinePrecision] * 1.0 + z), $MachinePrecision], If[LessEqual[t$95$2, 5e+307], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(y * i + t$95$1), $MachinePrecision]]]]]
\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)\\
\mathbf{if}\;t\_2 \leq 1.5 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. 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.5e114

    1. Initial program 99.9%

      \[\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 \]
    2. Add Preprocessing
    3. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} - 1\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} - 1\right)} \]
      2. sub-negN/A

        \[\leadsto \left(-1 \cdot z\right) \cdot \color{blue}{\left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      3. metadata-evalN/A

        \[\leadsto \left(-1 \cdot z\right) \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} + \color{blue}{-1}\right) \]
      4. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z}\right) \cdot \left(-1 \cdot z\right) + -1 \cdot \left(-1 \cdot z\right)} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot -1\right)} \cdot \left(-1 \cdot z\right) + -1 \cdot \left(-1 \cdot z\right) \]
      6. associate-*l*N/A

        \[\leadsto \color{blue}{\frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \left(-1 \cdot \left(-1 \cdot z\right)\right)} + -1 \cdot \left(-1 \cdot z\right) \]
      7. associate-*r*N/A

        \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \color{blue}{\left(\left(-1 \cdot -1\right) \cdot z\right)} + -1 \cdot \left(-1 \cdot z\right) \]
      8. metadata-evalN/A

        \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \left(\color{blue}{1} \cdot z\right) + -1 \cdot \left(-1 \cdot z\right) \]
      9. *-lft-identityN/A

        \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \color{blue}{z} + -1 \cdot \left(-1 \cdot z\right) \]
      10. associate-*r*N/A

        \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot z + \color{blue}{\left(-1 \cdot -1\right) \cdot z} \]
    5. Applied rewrites77.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)\right) + a}{z}, z, z\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(\frac{x \cdot \log y}{z}, z, z\right) \]
    7. Step-by-step derivation
      1. Applied rewrites25.2%

        \[\leadsto \mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, z\right) \]
      2. Step-by-step derivation
        1. Applied rewrites27.9%

          \[\leadsto \mathsf{fma}\left(\log y \cdot x, \color{blue}{1}, z\right) \]
        2. Taylor expanded in y around inf

          \[\leadsto \mathsf{fma}\left(i \cdot y, 1, z\right) \]
        3. Step-by-step derivation
          1. Applied rewrites41.1%

            \[\leadsto \mathsf{fma}\left(i \cdot y, 1, z\right) \]

          if 1.5e114 < (+.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)) < 5e307

          1. Initial program 99.8%

            \[\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 \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
          4. Step-by-step derivation
            1. associate-+r+N/A

              \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
            2. lower-+.f64N/A

              \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
            3. +-commutativeN/A

              \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            4. lower-+.f64N/A

              \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
            5. associate-+r+N/A

              \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
            6. +-commutativeN/A

              \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
            7. *-commutativeN/A

              \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
            8. lower-fma.f64N/A

              \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
            9. lower--.f64N/A

              \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
            10. lower-log.f64N/A

              \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
            11. +-commutativeN/A

              \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
            12. *-commutativeN/A

              \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
            13. lower-fma.f6485.5

              \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
          5. Applied rewrites85.5%

            \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
          6. Taylor expanded in b around inf

            \[\leadsto \left(t + a\right) + b \cdot \color{blue}{\log c} \]
          7. Step-by-step derivation
            1. Applied rewrites66.4%

              \[\leadsto \left(t + a\right) + b \cdot \color{blue}{\log c} \]

            if 5e307 < (+.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. Initial program 100.0%

              \[\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 \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
              3. lower-log.f6488.7

                \[\leadsto \color{blue}{\log y} \cdot x + y \cdot i \]
            5. Applied rewrites88.7%

              \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
            6. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\log y \cdot x + y \cdot i} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{y \cdot i + \log y \cdot x} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
              4. lower-fma.f6488.7

                \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
            7. Applied rewrites88.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification54.4%

            \[\leadsto \begin{array}{l} \mathbf{if}\;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) \leq 1.5 \cdot 10^{+114}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\ \mathbf{elif}\;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) \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\log c \cdot b + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 3: 45.8% accurate, 0.4× speedup?

          \[\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.5 \cdot 10^{+114}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\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} \]
          (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 1.5e+114)
               (fma (* i y) 1.0 z)
               (if (<= t_1 5e+307)
                 (+ (* (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 <= 1.5e+114) {
          		tmp = fma((i * y), 1.0, z);
          	} else if (t_1 <= 5e+307) {
          		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 <= 1.5e+114)
          		tmp = fma(Float64(i * y), 1.0, z);
          	elseif (t_1 <= 5e+307)
          		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, 1.5e+114], N[(N[(i * y), $MachinePrecision] * 1.0 + z), $MachinePrecision], If[LessEqual[t$95$1, 5e+307], 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.5 \cdot 10^{+114}:\\
          \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\
          
          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+307}:\\
          \;\;\;\;\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}
          
          Derivation
          1. Split input into 3 regimes
          2. 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.5e114

            1. Initial program 99.9%

              \[\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 \]
            2. Add Preprocessing
            3. Taylor expanded in z around -inf

              \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} - 1\right)\right)} \]
            4. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} - 1\right)} \]
              2. sub-negN/A

                \[\leadsto \left(-1 \cdot z\right) \cdot \color{blue}{\left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
              3. metadata-evalN/A

                \[\leadsto \left(-1 \cdot z\right) \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} + \color{blue}{-1}\right) \]
              4. distribute-rgt-inN/A

                \[\leadsto \color{blue}{\left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z}\right) \cdot \left(-1 \cdot z\right) + -1 \cdot \left(-1 \cdot z\right)} \]
              5. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot -1\right)} \cdot \left(-1 \cdot z\right) + -1 \cdot \left(-1 \cdot z\right) \]
              6. associate-*l*N/A

                \[\leadsto \color{blue}{\frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \left(-1 \cdot \left(-1 \cdot z\right)\right)} + -1 \cdot \left(-1 \cdot z\right) \]
              7. associate-*r*N/A

                \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \color{blue}{\left(\left(-1 \cdot -1\right) \cdot z\right)} + -1 \cdot \left(-1 \cdot z\right) \]
              8. metadata-evalN/A

                \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \left(\color{blue}{1} \cdot z\right) + -1 \cdot \left(-1 \cdot z\right) \]
              9. *-lft-identityN/A

                \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \color{blue}{z} + -1 \cdot \left(-1 \cdot z\right) \]
              10. associate-*r*N/A

                \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot z + \color{blue}{\left(-1 \cdot -1\right) \cdot z} \]
            5. Applied rewrites77.2%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)\right) + a}{z}, z, z\right)} \]
            6. Taylor expanded in x around inf

              \[\leadsto \mathsf{fma}\left(\frac{x \cdot \log y}{z}, z, z\right) \]
            7. Step-by-step derivation
              1. Applied rewrites25.2%

                \[\leadsto \mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, z\right) \]
              2. Step-by-step derivation
                1. Applied rewrites27.9%

                  \[\leadsto \mathsf{fma}\left(\log y \cdot x, \color{blue}{1}, z\right) \]
                2. Taylor expanded in y around inf

                  \[\leadsto \mathsf{fma}\left(i \cdot y, 1, z\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites41.1%

                    \[\leadsto \mathsf{fma}\left(i \cdot y, 1, z\right) \]

                  if 1.5e114 < (+.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)) < 5e307

                  1. Initial program 99.8%

                    \[\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 \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                  4. Step-by-step derivation
                    1. associate-+r+N/A

                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                    2. lower-+.f64N/A

                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                    3. +-commutativeN/A

                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                    4. lower-+.f64N/A

                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                    5. associate-+r+N/A

                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                    6. +-commutativeN/A

                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                    7. *-commutativeN/A

                      \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                    8. lower-fma.f64N/A

                      \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                    9. lower--.f64N/A

                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                    10. lower-log.f64N/A

                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                    11. +-commutativeN/A

                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                    13. lower-fma.f6485.5

                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                  5. Applied rewrites85.5%

                    \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                  6. Taylor expanded in b around inf

                    \[\leadsto \left(t + a\right) + b \cdot \color{blue}{\log c} \]
                  7. Step-by-step derivation
                    1. Applied rewrites66.4%

                      \[\leadsto \left(t + a\right) + b \cdot \color{blue}{\log c} \]

                    if 5e307 < (+.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. Initial program 100.0%

                      \[\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 \]
                    2. Add Preprocessing
                    3. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                    4. Step-by-step derivation
                      1. associate-+r+N/A

                        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                      2. lower-+.f64N/A

                        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                      3. +-commutativeN/A

                        \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                      4. lower-+.f64N/A

                        \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                      5. associate-+r+N/A

                        \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                      6. +-commutativeN/A

                        \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                      7. *-commutativeN/A

                        \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                      8. lower-fma.f64N/A

                        \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                      9. lower--.f64N/A

                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                      10. lower-log.f64N/A

                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                      11. +-commutativeN/A

                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                      13. lower-fma.f6488.5

                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                    5. Applied rewrites88.5%

                      \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                    6. Taylor expanded in y around inf

                      \[\leadsto \left(t + a\right) + i \cdot \color{blue}{y} \]
                    7. Step-by-step derivation
                      1. Applied rewrites76.7%

                        \[\leadsto \left(t + a\right) + y \cdot \color{blue}{i} \]
                      2. Step-by-step derivation
                        1. Applied rewrites53.1%

                          \[\leadsto \frac{\left(t + a\right) \cdot \left(t - a\right)}{t - a} + \color{blue}{y} \cdot i \]
                      3. Recombined 3 regimes into one program.
                      4. Final simplification52.1%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;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) \leq 1.5 \cdot 10^{+114}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\ \mathbf{elif}\;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) \leq 5 \cdot 10^{+307}:\\ \;\;\;\;\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} \]
                      5. Add Preprocessing

                      Alternative 4: 45.7% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;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) \leq -100:\\ \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot y + \left(a + t\right)\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (if (<=
                            (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))
                            -100.0)
                         (fma (* i y) 1.0 z)
                         (+ (* 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 (((i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -100.0) {
                      		tmp = fma((i * y), 1.0, z);
                      	} else {
                      		tmp = (i * y) + (a + t);
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a, b, c, i)
                      	tmp = 0.0
                      	if (Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) <= -100.0)
                      		tmp = fma(Float64(i * y), 1.0, z);
                      	else
                      		tmp = Float64(Float64(i * y) + Float64(a + t));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], -100.0], N[(N[(i * y), $MachinePrecision] * 1.0 + z), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;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) \leq -100:\\
                      \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;i \cdot y + \left(a + t\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. 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)) < -100

                        1. Initial program 99.9%

                          \[\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 \]
                        2. Add Preprocessing
                        3. Taylor expanded in z around -inf

                          \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} - 1\right)\right)} \]
                        4. Step-by-step derivation
                          1. associate-*r*N/A

                            \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} - 1\right)} \]
                          2. sub-negN/A

                            \[\leadsto \left(-1 \cdot z\right) \cdot \color{blue}{\left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
                          3. metadata-evalN/A

                            \[\leadsto \left(-1 \cdot z\right) \cdot \left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} + \color{blue}{-1}\right) \]
                          4. distribute-rgt-inN/A

                            \[\leadsto \color{blue}{\left(-1 \cdot \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z}\right) \cdot \left(-1 \cdot z\right) + -1 \cdot \left(-1 \cdot z\right)} \]
                          5. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(\frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot -1\right)} \cdot \left(-1 \cdot z\right) + -1 \cdot \left(-1 \cdot z\right) \]
                          6. associate-*l*N/A

                            \[\leadsto \color{blue}{\frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \left(-1 \cdot \left(-1 \cdot z\right)\right)} + -1 \cdot \left(-1 \cdot z\right) \]
                          7. associate-*r*N/A

                            \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \color{blue}{\left(\left(-1 \cdot -1\right) \cdot z\right)} + -1 \cdot \left(-1 \cdot z\right) \]
                          8. metadata-evalN/A

                            \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \left(\color{blue}{1} \cdot z\right) + -1 \cdot \left(-1 \cdot z\right) \]
                          9. *-lft-identityN/A

                            \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot \color{blue}{z} + -1 \cdot \left(-1 \cdot z\right) \]
                          10. associate-*r*N/A

                            \[\leadsto \frac{a + \left(t + \left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)}{z} \cdot z + \color{blue}{\left(-1 \cdot -1\right) \cdot z} \]
                        5. Applied rewrites77.1%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)\right) + a}{z}, z, z\right)} \]
                        6. Taylor expanded in x around inf

                          \[\leadsto \mathsf{fma}\left(\frac{x \cdot \log y}{z}, z, z\right) \]
                        7. Step-by-step derivation
                          1. Applied rewrites26.1%

                            \[\leadsto \mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, z\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites29.1%

                              \[\leadsto \mathsf{fma}\left(\log y \cdot x, \color{blue}{1}, z\right) \]
                            2. Taylor expanded in y around inf

                              \[\leadsto \mathsf{fma}\left(i \cdot y, 1, z\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites41.2%

                                \[\leadsto \mathsf{fma}\left(i \cdot y, 1, z\right) \]

                              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))

                              1. Initial program 99.8%

                                \[\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 \]
                              2. Add Preprocessing
                              3. Taylor expanded in x around 0

                                \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                              4. Step-by-step derivation
                                1. associate-+r+N/A

                                  \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                2. lower-+.f64N/A

                                  \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                3. +-commutativeN/A

                                  \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                4. lower-+.f64N/A

                                  \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                5. associate-+r+N/A

                                  \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                6. +-commutativeN/A

                                  \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                7. *-commutativeN/A

                                  \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                8. lower-fma.f64N/A

                                  \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                9. lower--.f64N/A

                                  \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                10. lower-log.f64N/A

                                  \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                11. +-commutativeN/A

                                  \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                12. *-commutativeN/A

                                  \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                13. lower-fma.f6485.8

                                  \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                              5. Applied rewrites85.8%

                                \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                              6. Taylor expanded in y around inf

                                \[\leadsto \left(t + a\right) + i \cdot \color{blue}{y} \]
                              7. Step-by-step derivation
                                1. Applied rewrites54.1%

                                  \[\leadsto \left(t + a\right) + y \cdot \color{blue}{i} \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification47.9%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;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) \leq -100:\\ \;\;\;\;\mathsf{fma}\left(i \cdot y, 1, z\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot y + \left(a + t\right)\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 5: 91.3% accurate, 1.0× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\ \mathbf{if}\;i \leq -2.8 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 5.6 \cdot 10^{-24}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (let* ((t_1 (+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))))
                                 (if (<= i -2.8e+31)
                                   t_1
                                   (if (<= i 5.6e-24)
                                     (+ (fma (log y) x (fma (- b 0.5) (log c) 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(y, i, z)) + (a + t);
                              	double tmp;
                              	if (i <= -2.8e+31) {
                              		tmp = t_1;
                              	} else if (i <= 5.6e-24) {
                              		tmp = fma(log(y), x, fma((b - 0.5), log(c), 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(y, i, z)) + Float64(a + t))
                              	tmp = 0.0
                              	if (i <= -2.8e+31)
                              		tmp = t_1;
                              	elseif (i <= 5.6e-24)
                              		tmp = Float64(fma(log(y), x, fma(Float64(b - 0.5), log(c), 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[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.8e+31], t$95$1, If[LessEqual[i, 5.6e-24], N[(N[(N[Log[y], $MachinePrecision] * x + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + 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(y, i, z\right)\right) + \left(a + t\right)\\
                              \mathbf{if}\;i \leq -2.8 \cdot 10^{+31}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;i \leq 5.6 \cdot 10^{-24}:\\
                              \;\;\;\;\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right) + \left(a + t\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if i < -2.80000000000000017e31 or 5.6000000000000003e-24 < i

                                1. Initial program 99.9%

                                  \[\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 \]
                                2. Add Preprocessing
                                3. Taylor expanded in x around 0

                                  \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                4. Step-by-step derivation
                                  1. associate-+r+N/A

                                    \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                  2. lower-+.f64N/A

                                    \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                  3. +-commutativeN/A

                                    \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                  4. lower-+.f64N/A

                                    \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                  5. associate-+r+N/A

                                    \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                  6. +-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                  7. *-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                  8. lower-fma.f64N/A

                                    \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                  9. lower--.f64N/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                  10. lower-log.f64N/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                  11. +-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                  12. *-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                  13. lower-fma.f6492.6

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                5. Applied rewrites92.6%

                                  \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]

                                if -2.80000000000000017e31 < i < 5.6000000000000003e-24

                                1. Initial program 99.8%

                                  \[\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 \]
                                2. Add Preprocessing
                                3. Taylor expanded in y around 0

                                  \[\leadsto \color{blue}{a + \left(t + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                4. Step-by-step derivation
                                  1. associate-+r+N/A

                                    \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                  2. lower-+.f64N/A

                                    \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                  3. +-commutativeN/A

                                    \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                  4. lower-+.f64N/A

                                    \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                  5. +-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right) + z\right)} \]
                                  6. associate-+l+N/A

                                    \[\leadsto \left(t + a\right) + \color{blue}{\left(x \cdot \log y + \left(\log c \cdot \left(b - \frac{1}{2}\right) + z\right)\right)} \]
                                  7. +-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \left(x \cdot \log y + \color{blue}{\left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)}\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \left(\color{blue}{\log y \cdot x} + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                  9. lower-fma.f64N/A

                                    \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(\log y, x, z + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                  10. lower-log.f64N/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{\log y}, x, z + \log c \cdot \left(b - \frac{1}{2}\right)\right) \]
                                  11. +-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\log y, x, \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right) + z}\right) \]
                                  12. *-commutativeN/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\log y, x, \color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + z\right) \]
                                  13. lower-fma.f64N/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z\right)}\right) \]
                                  14. lower--.f64N/A

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z\right)\right) \]
                                  15. lower-log.f6498.2

                                    \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \color{blue}{\log c}, z\right)\right) \]
                                5. Applied rewrites98.2%

                                  \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right)} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification95.5%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2.8 \cdot 10^{+31}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\ \mathbf{elif}\;i \leq 5.6 \cdot 10^{-24}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 6: 90.6% accurate, 1.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+220}:\\ \;\;\;\;\left(\frac{a}{x} + \log y\right) \cdot x + i \cdot y\\ \mathbf{elif}\;x \leq 6.3 \cdot 10^{+246}:\\ \;\;\;\;\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(y, i, \log y \cdot x\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (if (<= x -5.5e+220)
                                 (+ (* (+ (/ a x) (log y)) x) (* i y))
                                 (if (<= x 6.3e+246)
                                   (+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
                                   (fma y i (* (log y) x)))))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	double tmp;
                              	if (x <= -5.5e+220) {
                              		tmp = (((a / x) + log(y)) * x) + (i * y);
                              	} else if (x <= 6.3e+246) {
                              		tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
                              	} else {
                              		tmp = fma(y, i, (log(y) * x));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	tmp = 0.0
                              	if (x <= -5.5e+220)
                              		tmp = Float64(Float64(Float64(Float64(a / x) + log(y)) * x) + Float64(i * y));
                              	elseif (x <= 6.3e+246)
                              		tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t));
                              	else
                              		tmp = fma(y, i, Float64(log(y) * x));
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -5.5e+220], N[(N[(N[(N[(a / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.3e+246], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;x \leq -5.5 \cdot 10^{+220}:\\
                              \;\;\;\;\left(\frac{a}{x} + \log y\right) \cdot x + i \cdot y\\
                              
                              \mathbf{elif}\;x \leq 6.3 \cdot 10^{+246}:\\
                              \;\;\;\;\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(y, i, \log y \cdot x\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if x < -5.4999999999999999e220

                                1. Initial program 99.7%

                                  \[\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 \]
                                2. Add Preprocessing
                                3. Taylor expanded in x around inf

                                  \[\leadsto \color{blue}{x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{x}\right)\right)\right)\right)} + y \cdot i \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{x}\right)\right)\right)\right) \cdot x} + y \cdot i \]
                                  2. lower-*.f64N/A

                                    \[\leadsto \color{blue}{\left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{x}\right)\right)\right)\right) \cdot x} + y \cdot i \]
                                5. Applied rewrites99.7%

                                  \[\leadsto \color{blue}{\left(\left(\left(\mathsf{fma}\left(\frac{\log c}{x}, b - 0.5, \frac{z}{x}\right) + \frac{t}{x}\right) + \frac{a}{x}\right) + \log y\right) \cdot x} + y \cdot i \]
                                6. Taylor expanded in a around inf

                                  \[\leadsto \left(\frac{a}{x} + \log y\right) \cdot x + y \cdot i \]
                                7. Step-by-step derivation
                                  1. Applied rewrites93.7%

                                    \[\leadsto \left(\frac{a}{x} + \log y\right) \cdot x + y \cdot i \]

                                  if -5.4999999999999999e220 < x < 6.3e246

                                  1. Initial program 99.9%

                                    \[\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 \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in x around 0

                                    \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. associate-+r+N/A

                                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                    2. lower-+.f64N/A

                                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                    3. +-commutativeN/A

                                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    4. lower-+.f64N/A

                                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    5. associate-+r+N/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                    7. *-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                    8. lower-fma.f64N/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                    9. lower--.f64N/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                    10. lower-log.f64N/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                    11. +-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                    12. *-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                    13. lower-fma.f6493.4

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                  5. Applied rewrites93.4%

                                    \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]

                                  if 6.3e246 < x

                                  1. Initial program 99.5%

                                    \[\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 \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in x around inf

                                    \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                    3. lower-log.f6499.5

                                      \[\leadsto \color{blue}{\log y} \cdot x + y \cdot i \]
                                  5. Applied rewrites99.5%

                                    \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                  6. Step-by-step derivation
                                    1. lift-+.f64N/A

                                      \[\leadsto \color{blue}{\log y \cdot x + y \cdot i} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \color{blue}{y \cdot i + \log y \cdot x} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                    4. lower-fma.f6499.5

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                  7. Applied rewrites99.5%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                8. Recombined 3 regimes into one program.
                                9. Final simplification93.6%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+220}:\\ \;\;\;\;\left(\frac{a}{x} + \log y\right) \cdot x + i \cdot y\\ \mathbf{elif}\;x \leq 6.3 \cdot 10^{+246}:\\ \;\;\;\;\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(y, i, \log y \cdot x\right)\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 7: 90.2% accurate, 1.7× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{if}\;x \leq -6 \cdot 10^{+220}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6.3 \cdot 10^{+246}:\\ \;\;\;\;\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} \]
                                (FPCore (x y z t a b c i)
                                 :precision binary64
                                 (let* ((t_1 (fma y i (* (log y) x))))
                                   (if (<= x -6e+220)
                                     t_1
                                     (if (<= x 6.3e+246)
                                       (+ (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(y, i, (log(y) * x));
                                	double tmp;
                                	if (x <= -6e+220) {
                                		tmp = t_1;
                                	} else if (x <= 6.3e+246) {
                                		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 = fma(y, i, Float64(log(y) * x))
                                	tmp = 0.0
                                	if (x <= -6e+220)
                                		tmp = t_1;
                                	elseif (x <= 6.3e+246)
                                		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[(y * i + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+220], t$95$1, If[LessEqual[x, 6.3e+246], 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(y, i, \log y \cdot x\right)\\
                                \mathbf{if}\;x \leq -6 \cdot 10^{+220}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;x \leq 6.3 \cdot 10^{+246}:\\
                                \;\;\;\;\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}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -6.00000000000000048e220 or 6.3e246 < x

                                  1. Initial program 99.7%

                                    \[\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 \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in x around inf

                                    \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                    3. lower-log.f6491.5

                                      \[\leadsto \color{blue}{\log y} \cdot x + y \cdot i \]
                                  5. Applied rewrites91.5%

                                    \[\leadsto \color{blue}{\log y \cdot x} + y \cdot i \]
                                  6. Step-by-step derivation
                                    1. lift-+.f64N/A

                                      \[\leadsto \color{blue}{\log y \cdot x + y \cdot i} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \color{blue}{y \cdot i + \log y \cdot x} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{y \cdot i} + \log y \cdot x \]
                                    4. lower-fma.f6491.5

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]
                                  7. Applied rewrites91.5%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \log y \cdot x\right)} \]

                                  if -6.00000000000000048e220 < x < 6.3e246

                                  1. Initial program 99.9%

                                    \[\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 \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in x around 0

                                    \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. associate-+r+N/A

                                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                    2. lower-+.f64N/A

                                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                    3. +-commutativeN/A

                                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    4. lower-+.f64N/A

                                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    5. associate-+r+N/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                    7. *-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                    8. lower-fma.f64N/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                    9. lower--.f64N/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                    10. lower-log.f64N/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                    11. +-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                    12. *-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                    13. lower-fma.f6493.4

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                  5. Applied rewrites93.4%

                                    \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                                3. Recombined 2 regimes into one program.
                                4. Final simplification93.2%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+220}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \log y \cdot x\right)\\ \mathbf{elif}\;x \leq 6.3 \cdot 10^{+246}:\\ \;\;\;\;\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(y, i, \log y \cdot x\right)\\ \end{array} \]
                                5. Add Preprocessing

                                Alternative 8: 75.7% accurate, 1.8× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-0.5 + b, \log c, i \cdot y\right) + \left(a + t\right)\\ \mathbf{if}\;i \leq -5.3 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 2.9 \cdot 10^{+85}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                (FPCore (x y z t a b c i)
                                 :precision binary64
                                 (let* ((t_1 (+ (fma (+ -0.5 b) (log c) (* i y)) (+ a t))))
                                   (if (<= i -5.3e+31)
                                     t_1
                                     (if (<= i 2.9e+85) (+ (fma (- b 0.5) (log c) 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((-0.5 + b), log(c), (i * y)) + (a + t);
                                	double tmp;
                                	if (i <= -5.3e+31) {
                                		tmp = t_1;
                                	} else if (i <= 2.9e+85) {
                                		tmp = fma((b - 0.5), log(c), z) + (a + t);
                                	} else {
                                		tmp = t_1;
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, t, a, b, c, i)
                                	t_1 = Float64(fma(Float64(-0.5 + b), log(c), Float64(i * y)) + Float64(a + t))
                                	tmp = 0.0
                                	if (i <= -5.3e+31)
                                		tmp = t_1;
                                	elseif (i <= 2.9e+85)
                                		tmp = Float64(fma(Float64(b - 0.5), log(c), 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[(-0.5 + b), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -5.3e+31], t$95$1, If[LessEqual[i, 2.9e+85], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := \mathsf{fma}\left(-0.5 + b, \log c, i \cdot y\right) + \left(a + t\right)\\
                                \mathbf{if}\;i \leq -5.3 \cdot 10^{+31}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;i \leq 2.9 \cdot 10^{+85}:\\
                                \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_1\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if i < -5.3000000000000003e31 or 2.89999999999999997e85 < i

                                  1. Initial program 99.9%

                                    \[\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 \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in x around 0

                                    \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. associate-+r+N/A

                                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                    2. lower-+.f64N/A

                                      \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                    3. +-commutativeN/A

                                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    4. lower-+.f64N/A

                                      \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                    5. associate-+r+N/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                    7. *-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                    8. lower-fma.f64N/A

                                      \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                    9. lower--.f64N/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                    10. lower-log.f64N/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                    11. +-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                    12. *-commutativeN/A

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                    13. lower-fma.f6492.8

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                  5. Applied rewrites92.8%

                                    \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                                  6. Taylor expanded in z around 0

                                    \[\leadsto \left(t + a\right) + \left(i \cdot y + \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right)}\right) \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites88.1%

                                      \[\leadsto \left(t + a\right) + \mathsf{fma}\left(-0.5 + b, \color{blue}{\log c}, y \cdot i\right) \]

                                    if -5.3000000000000003e31 < i < 2.89999999999999997e85

                                    1. Initial program 99.9%

                                      \[\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 \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in x around 0

                                      \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                    4. Step-by-step derivation
                                      1. associate-+r+N/A

                                        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                      2. lower-+.f64N/A

                                        \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                      3. +-commutativeN/A

                                        \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                      4. lower-+.f64N/A

                                        \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                      5. associate-+r+N/A

                                        \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                      6. +-commutativeN/A

                                        \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                      7. *-commutativeN/A

                                        \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                      8. lower-fma.f64N/A

                                        \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                      9. lower--.f64N/A

                                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                      10. lower-log.f64N/A

                                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                      11. +-commutativeN/A

                                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                      12. *-commutativeN/A

                                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                      13. lower-fma.f6481.6

                                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                    5. Applied rewrites81.6%

                                      \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                                    6. Taylor expanded in y around 0

                                      \[\leadsto \left(t + a\right) + \left(z + \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right)}\right) \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites78.3%

                                        \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \color{blue}{\log c}, z\right) \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification82.0%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5.3 \cdot 10^{+31}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 + b, \log c, i \cdot y\right) + \left(a + t\right)\\ \mathbf{elif}\;i \leq 2.9 \cdot 10^{+85}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 + b, \log c, i \cdot y\right) + \left(a + t\right)\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 9: 68.2% accurate, 1.8× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log c \cdot b + i \cdot y\\ \mathbf{if}\;i \leq -8 \cdot 10^{+110}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \leq 3.3 \cdot 10^{+85}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                    (FPCore (x y z t a b c i)
                                     :precision binary64
                                     (let* ((t_1 (+ (* (log c) b) (* i y))))
                                       (if (<= i -8e+110)
                                         t_1
                                         (if (<= i 3.3e+85) (+ (fma (- b 0.5) (log c) 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(c) * b) + (i * y);
                                    	double tmp;
                                    	if (i <= -8e+110) {
                                    		tmp = t_1;
                                    	} else if (i <= 3.3e+85) {
                                    		tmp = fma((b - 0.5), log(c), z) + (a + t);
                                    	} else {
                                    		tmp = t_1;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, t, a, b, c, i)
                                    	t_1 = Float64(Float64(log(c) * b) + Float64(i * y))
                                    	tmp = 0.0
                                    	if (i <= -8e+110)
                                    		tmp = t_1;
                                    	elseif (i <= 3.3e+85)
                                    		tmp = Float64(fma(Float64(b - 0.5), log(c), 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[c], $MachinePrecision] * b), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -8e+110], t$95$1, If[LessEqual[i, 3.3e+85], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_1 := \log c \cdot b + i \cdot y\\
                                    \mathbf{if}\;i \leq -8 \cdot 10^{+110}:\\
                                    \;\;\;\;t\_1\\
                                    
                                    \mathbf{elif}\;i \leq 3.3 \cdot 10^{+85}:\\
                                    \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_1\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if i < -8.0000000000000002e110 or 3.2999999999999999e85 < i

                                      1. Initial program 99.9%

                                        \[\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 \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in b around inf

                                        \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
                                      4. Step-by-step derivation
                                        1. lower-*.f64N/A

                                          \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]
                                        2. lower-log.f6477.5

                                          \[\leadsto b \cdot \color{blue}{\log c} + y \cdot i \]
                                      5. Applied rewrites77.5%

                                        \[\leadsto \color{blue}{b \cdot \log c} + y \cdot i \]

                                      if -8.0000000000000002e110 < i < 3.2999999999999999e85

                                      1. Initial program 99.9%

                                        \[\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 \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in x around 0

                                        \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                      4. Step-by-step derivation
                                        1. associate-+r+N/A

                                          \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                        2. lower-+.f64N/A

                                          \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                        3. +-commutativeN/A

                                          \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                        4. lower-+.f64N/A

                                          \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                        5. associate-+r+N/A

                                          \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                        6. +-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                        7. *-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                        8. lower-fma.f64N/A

                                          \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                        9. lower--.f64N/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                        10. lower-log.f64N/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                        11. +-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                        12. *-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                        13. lower-fma.f6482.7

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                      5. Applied rewrites82.7%

                                        \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                                      6. Taylor expanded in y around 0

                                        \[\leadsto \left(t + a\right) + \left(z + \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right)}\right) \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites78.5%

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \color{blue}{\log c}, z\right) \]
                                      8. Recombined 2 regimes into one program.
                                      9. Final simplification78.1%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -8 \cdot 10^{+110}:\\ \;\;\;\;\log c \cdot b + i \cdot y\\ \mathbf{elif}\;i \leq 3.3 \cdot 10^{+85}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\log c \cdot b + i \cdot y\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 10: 52.9% accurate, 19.5× speedup?

                                      \[\begin{array}{l} \\ i \cdot y + \left(a + t\right) \end{array} \]
                                      (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}
                                      
                                      Derivation
                                      1. Initial program 99.9%

                                        \[\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 \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in x around 0

                                        \[\leadsto \color{blue}{a + \left(t + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right)} \]
                                      4. Step-by-step derivation
                                        1. associate-+r+N/A

                                          \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                        2. lower-+.f64N/A

                                          \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                                        3. +-commutativeN/A

                                          \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                        4. lower-+.f64N/A

                                          \[\leadsto \color{blue}{\left(t + a\right)} + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) \]
                                        5. associate-+r+N/A

                                          \[\leadsto \left(t + a\right) + \color{blue}{\left(\left(z + i \cdot y\right) + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
                                        6. +-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \color{blue}{\left(\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + i \cdot y\right)\right)} \]
                                        7. *-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \left(\color{blue}{\left(b - \frac{1}{2}\right) \cdot \log c} + \left(z + i \cdot y\right)\right) \]
                                        8. lower-fma.f64N/A

                                          \[\leadsto \left(t + a\right) + \color{blue}{\mathsf{fma}\left(b - \frac{1}{2}, \log c, z + i \cdot y\right)} \]
                                        9. lower--.f64N/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(\color{blue}{b - \frac{1}{2}}, \log c, z + i \cdot y\right) \]
                                        10. lower-log.f64N/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \color{blue}{\log c}, z + i \cdot y\right) \]
                                        11. +-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                                        12. *-commutativeN/A

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{y \cdot i} + z\right) \]
                                        13. lower-fma.f6485.8

                                          \[\leadsto \left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{\mathsf{fma}\left(y, i, z\right)}\right) \]
                                      5. Applied rewrites85.8%

                                        \[\leadsto \color{blue}{\left(t + a\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right)} \]
                                      6. Taylor expanded in y around inf

                                        \[\leadsto \left(t + a\right) + i \cdot \color{blue}{y} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites53.9%

                                          \[\leadsto \left(t + a\right) + y \cdot \color{blue}{i} \]
                                        2. Final simplification53.9%

                                          \[\leadsto i \cdot y + \left(a + t\right) \]
                                        3. Add Preprocessing

                                        Alternative 11: 23.9% accurate, 39.0× speedup?

                                        \[\begin{array}{l} \\ i \cdot y \end{array} \]
                                        (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}
                                        
                                        Derivation
                                        1. Initial program 99.9%

                                          \[\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 \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in y around inf

                                          \[\leadsto \color{blue}{i \cdot y} \]
                                        4. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto \color{blue}{y \cdot i} \]
                                          2. lower-*.f6424.4

                                            \[\leadsto \color{blue}{y \cdot i} \]
                                        5. Applied rewrites24.4%

                                          \[\leadsto \color{blue}{y \cdot i} \]
                                        6. Final simplification24.4%

                                          \[\leadsto i \cdot y \]
                                        7. Add Preprocessing

                                        Reproduce

                                        ?
                                        herbie shell --seed 2024235 
                                        (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)))