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

Percentage Accurate: 99.8% → 99.8%
Time: 9.4s
Alternatives: 15
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 15 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} \\ \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}
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. Add Preprocessing

Alternative 2: 42.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\\ \mathbf{elif}\;t\_1 \leq 10^{+175} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{i} \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1
         (+
          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
          (* y i))))
   (if (<= t_1 (- INFINITY))
     (* i y)
     (if (<= t_1 5e+94)
       (+ (fma (log c) (- b 0.5) z) t)
       (if (or (<= t_1 1e+175) (not (<= t_1 2e+306)))
         (* i y)
         (* (/ a i) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = i * y;
	} else if (t_1 <= 5e+94) {
		tmp = fma(log(c), (b - 0.5), z) + t;
	} else if ((t_1 <= 1e+175) || !(t_1 <= 2e+306)) {
		tmp = i * y;
	} else {
		tmp = (a / i) * i;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(i * y);
	elseif (t_1 <= 5e+94)
		tmp = Float64(fma(log(c), Float64(b - 0.5), z) + t);
	elseif ((t_1 <= 1e+175) || !(t_1 <= 2e+306))
		tmp = Float64(i * y);
	else
		tmp = Float64(Float64(a / i) * i);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 5e+94], N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision], If[Or[LessEqual[t$95$1, 1e+175], N[Not[LessEqual[t$95$1, 2e+306]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \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\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\\

\mathbf{elif}\;t\_1 \leq 10^{+175} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\
\;\;\;\;i \cdot y\\

\mathbf{else}:\\
\;\;\;\;\frac{a}{i} \cdot i\\


\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)) < -inf.0 or 5.0000000000000001e94 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 9.9999999999999994e174 or 2.00000000000000003e306 < (+.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 y around inf

      \[\leadsto \color{blue}{i \cdot y} \]
    4. Step-by-step derivation
      1. lower-*.f6475.3

        \[\leadsto \color{blue}{i \cdot y} \]
    5. Applied rewrites75.3%

      \[\leadsto \color{blue}{i \cdot y} \]

    if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 5.0000000000000001e94

    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. 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) \]
      4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 9.9999999999999994e174 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2.00000000000000003e306

        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 i around inf

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

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

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

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

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

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

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

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

          \[\leadsto \frac{a}{i} \cdot i \]
        7. Step-by-step derivation
          1. Applied rewrites10.0%

            \[\leadsto \frac{a}{i} \cdot i \]
        8. Recombined 3 regimes into one program.
        9. Final simplification46.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\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 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;\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 \leq 5 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\\ \mathbf{elif}\;\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 \leq 10^{+175} \lor \neg \left(\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 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{i} \cdot i\\ \end{array} \]
        10. Add Preprocessing

        Alternative 3: 22.5% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq -50000000:\\ \;\;\;\;\frac{z}{i} \cdot i\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\ \;\;\;\;\frac{a}{i} \cdot i\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c i)
         :precision binary64
         (let* ((t_1
                 (+
                  (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                  (* y i))))
           (if (<= t_1 (- INFINITY))
             (* i y)
             (if (<= t_1 -50000000.0)
               (* (/ z i) i)
               (if (<= t_1 2e+306) (* (/ a i) i) (* i y))))))
        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
        	double tmp;
        	if (t_1 <= -((double) INFINITY)) {
        		tmp = i * y;
        	} else if (t_1 <= -50000000.0) {
        		tmp = (z / i) * i;
        	} else if (t_1 <= 2e+306) {
        		tmp = (a / i) * i;
        	} else {
        		tmp = i * y;
        	}
        	return tmp;
        }
        
        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
        	double tmp;
        	if (t_1 <= -Double.POSITIVE_INFINITY) {
        		tmp = i * y;
        	} else if (t_1 <= -50000000.0) {
        		tmp = (z / i) * i;
        	} else if (t_1 <= 2e+306) {
        		tmp = (a / i) * i;
        	} else {
        		tmp = i * y;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b, c, i):
        	t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
        	tmp = 0
        	if t_1 <= -math.inf:
        		tmp = i * y
        	elif t_1 <= -50000000.0:
        		tmp = (z / i) * i
        	elif t_1 <= 2e+306:
        		tmp = (a / i) * i
        	else:
        		tmp = i * y
        	return tmp
        
        function code(x, y, z, t, a, b, c, i)
        	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
        	tmp = 0.0
        	if (t_1 <= Float64(-Inf))
        		tmp = Float64(i * y);
        	elseif (t_1 <= -50000000.0)
        		tmp = Float64(Float64(z / i) * i);
        	elseif (t_1 <= 2e+306)
        		tmp = Float64(Float64(a / i) * i);
        	else
        		tmp = Float64(i * y);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b, c, i)
        	t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
        	tmp = 0.0;
        	if (t_1 <= -Inf)
        		tmp = i * y;
        	elseif (t_1 <= -50000000.0)
        		tmp = (z / i) * i;
        	elseif (t_1 <= 2e+306)
        		tmp = (a / i) * i;
        	else
        		tmp = i * y;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -50000000.0], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \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\\
        \mathbf{if}\;t\_1 \leq -\infty:\\
        \;\;\;\;i \cdot y\\
        
        \mathbf{elif}\;t\_1 \leq -50000000:\\
        \;\;\;\;\frac{z}{i} \cdot i\\
        
        \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
        \;\;\;\;\frac{a}{i} \cdot i\\
        
        \mathbf{else}:\\
        \;\;\;\;i \cdot y\\
        
        
        \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)) < -inf.0 or 2.00000000000000003e306 < (+.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 y around inf

            \[\leadsto \color{blue}{i \cdot y} \]
          4. Step-by-step derivation
            1. lower-*.f6494.5

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

            \[\leadsto \color{blue}{i \cdot y} \]

          if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -5e7

          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 i around inf

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

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

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

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

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

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

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

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

            \[\leadsto \frac{z}{i} \cdot i \]
          7. Step-by-step derivation
            1. Applied rewrites7.5%

              \[\leadsto \frac{z}{i} \cdot i \]

            if -5e7 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2.00000000000000003e306

            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 i around inf

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

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

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

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

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

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

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

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

              \[\leadsto \frac{a}{i} \cdot i \]
            7. Step-by-step derivation
              1. Applied rewrites9.8%

                \[\leadsto \frac{a}{i} \cdot i \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 4: 72.9% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\\ \end{array} \end{array} \]
            (FPCore (x y z t a b c i)
             :precision binary64
             (let* ((t_1
                     (+
                      (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                      (* y i))))
               (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+306)))
                 (* i y)
                 (+ (+ (fma (log c) (- b 0.5) z) t) a))))
            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
            	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
            	double tmp;
            	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+306)) {
            		tmp = i * y;
            	} else {
            		tmp = (fma(log(c), (b - 0.5), z) + t) + a;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b, c, i)
            	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
            	tmp = 0.0
            	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+306))
            		tmp = Float64(i * y);
            	else
            		tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+306]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \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\\
            \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\
            \;\;\;\;i \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\\
            
            
            \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)) < -inf.0 or 2.00000000000000003e306 < (+.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 y around inf

                \[\leadsto \color{blue}{i \cdot y} \]
              4. Step-by-step derivation
                1. lower-*.f6494.5

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

                \[\leadsto \color{blue}{i \cdot y} \]

              if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2.00000000000000003e306

              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. 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) \]
                4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\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 \leq -\infty \lor \neg \left(\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 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\\ \end{array} \]
                6. Add Preprocessing

                Alternative 5: 58.8% accurate, 0.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \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\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, z\right) + a\\ \end{array} \end{array} \]
                (FPCore (x y z t a b c i)
                 :precision binary64
                 (let* ((t_1
                         (+
                          (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
                          (* y i))))
                   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+306)))
                     (* i y)
                     (+ (fma (log c) (- b 0.5) z) a))))
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
                	double tmp;
                	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+306)) {
                		tmp = i * y;
                	} else {
                		tmp = fma(log(c), (b - 0.5), z) + a;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b, c, i)
                	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
                	tmp = 0.0
                	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+306))
                		tmp = Float64(i * y);
                	else
                		tmp = Float64(fma(log(c), Float64(b - 0.5), z) + a);
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+306]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + a), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \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\\
                \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\
                \;\;\;\;i \cdot y\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, z\right) + a\\
                
                
                \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)) < -inf.0 or 2.00000000000000003e306 < (+.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 y around inf

                    \[\leadsto \color{blue}{i \cdot y} \]
                  4. Step-by-step derivation
                    1. lower-*.f6494.5

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

                    \[\leadsto \color{blue}{i \cdot y} \]

                  if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2.00000000000000003e306

                  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. 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) \]
                    4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\log c, b - 0.5, z\right) + a \]
                      4. Recombined 2 regimes into one program.
                      5. Final simplification53.1%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\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 \leq -\infty \lor \neg \left(\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 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;i \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, z\right) + a\\ \end{array} \]
                      6. Add Preprocessing

                      Alternative 6: 66.1% accurate, 0.7× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - 0.5\right) \cdot \log c\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+212} \lor \neg \left(t\_1 \leq 10^{+85}\right):\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, t + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (let* ((t_1 (* (- b 0.5) (log c))))
                         (if (or (<= t_1 -1e+212) (not (<= t_1 1e+85)))
                           (fma (- b 0.5) (log c) (fma i y (+ t z)))
                           (+ (fma i y (fma -0.5 (log c) z)) a))))
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double t_1 = (b - 0.5) * log(c);
                      	double tmp;
                      	if ((t_1 <= -1e+212) || !(t_1 <= 1e+85)) {
                      		tmp = fma((b - 0.5), log(c), fma(i, y, (t + z)));
                      	} else {
                      		tmp = fma(i, y, fma(-0.5, log(c), z)) + a;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t, a, b, c, i)
                      	t_1 = Float64(Float64(b - 0.5) * log(c))
                      	tmp = 0.0
                      	if ((t_1 <= -1e+212) || !(t_1 <= 1e+85))
                      		tmp = fma(Float64(b - 0.5), log(c), fma(i, y, Float64(t + z)));
                      	else
                      		tmp = Float64(fma(i, y, fma(-0.5, log(c), z)) + a);
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+212], N[Not[LessEqual[t$95$1, 1e+85]], $MachinePrecision]], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + N[(-0.5 * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \left(b - 0.5\right) \cdot \log c\\
                      \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+212} \lor \neg \left(t\_1 \leq 10^{+85}\right):\\
                      \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, t + z\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.9999999999999991e211 or 1e85 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

                        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 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. 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) \]
                          4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(t + z\right) + \color{blue}{\mathsf{fma}\left(\log c, b - 0.5, i \cdot y\right)} \]
                          2. Step-by-step derivation
                            1. Applied rewrites90.7%

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

                            if -9.9999999999999991e211 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e85

                            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 t around 0

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(i, y, z + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                            7. Step-by-step derivation
                              1. Applied rewrites60.6%

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

                                \[\leadsto \mathsf{fma}\left(i, y, z + \frac{-1}{2} \cdot \log c\right) + a \]
                              3. Step-by-step derivation
                                1. Applied rewrites58.6%

                                  \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a \]
                              4. Recombined 2 regimes into one program.
                              5. Final simplification64.9%

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

                              Alternative 7: 85.1% accurate, 1.0× speedup?

                              \[\begin{array}{l} \\ \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right)\right) + a \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (+ (fma i y (fma (log y) x (fma (- b 0.5) (log c) z))) a))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	return fma(i, y, fma(log(y), x, fma((b - 0.5), log(c), z))) + a;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	return Float64(fma(i, y, fma(log(y), x, fma(Float64(b - 0.5), log(c), z))) + a)
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right)\right) + a
                              \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 t around 0

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

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

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

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

                              Alternative 8: 91.9% accurate, 1.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+181} \lor \neg \left(x \leq 3.8 \cdot 10^{+53}\right):\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b c i)
                               :precision binary64
                               (if (or (<= x -6.4e+181) (not (<= x 3.8e+53)))
                                 (+ (fma i y (fma (log y) x (* 1.0 z))) a)
                                 (+ (+ a t) (fma (- b 0.5) (log c) (fma i y z)))))
                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                              	double tmp;
                              	if ((x <= -6.4e+181) || !(x <= 3.8e+53)) {
                              		tmp = fma(i, y, fma(log(y), x, (1.0 * z))) + a;
                              	} else {
                              		tmp = (a + t) + fma((b - 0.5), log(c), fma(i, y, z));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t, a, b, c, i)
                              	tmp = 0.0
                              	if ((x <= -6.4e+181) || !(x <= 3.8e+53))
                              		tmp = Float64(fma(i, y, fma(log(y), x, Float64(1.0 * z))) + a);
                              	else
                              		tmp = Float64(Float64(a + t) + fma(Float64(b - 0.5), log(c), fma(i, y, z)));
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -6.4e+181], N[Not[LessEqual[x, 3.8e+53]], $MachinePrecision]], N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(1.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;x \leq -6.4 \cdot 10^{+181} \lor \neg \left(x \leq 3.8 \cdot 10^{+53}\right):\\
                              \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if x < -6.4000000000000001e181 or 3.79999999999999997e53 < x

                                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 t around 0

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, z \cdot \left(1 + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{z}\right)\right)\right) + a \]
                                7. Step-by-step derivation
                                  1. Applied rewrites84.0%

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

                                    \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites84.0%

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

                                    if -6.4000000000000001e181 < x < 3.79999999999999997e53

                                    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. 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) \]
                                      4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+181} \lor \neg \left(x \leq 3.8 \cdot 10^{+53}\right):\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\left(a + t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right)\\ \end{array} \]
                                  6. Add Preprocessing

                                  Alternative 9: 64.0% accurate, 1.7× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+196}:\\ \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, i \cdot y\right) + t\\ \mathbf{elif}\;b - 0.5 \leq 2 \cdot 10^{+160}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a b c i)
                                   :precision binary64
                                   (if (<= (- b 0.5) -1e+196)
                                     (+ (fma (log c) (- b 0.5) (* i y)) t)
                                     (if (<= (- b 0.5) 2e+160)
                                       (+ (fma i y (fma -0.5 (log c) z)) a)
                                       (+ (+ (fma (log c) (- b 0.5) z) t) a))))
                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                  	double tmp;
                                  	if ((b - 0.5) <= -1e+196) {
                                  		tmp = fma(log(c), (b - 0.5), (i * y)) + t;
                                  	} else if ((b - 0.5) <= 2e+160) {
                                  		tmp = fma(i, y, fma(-0.5, log(c), z)) + a;
                                  	} else {
                                  		tmp = (fma(log(c), (b - 0.5), z) + t) + a;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(x, y, z, t, a, b, c, i)
                                  	tmp = 0.0
                                  	if (Float64(b - 0.5) <= -1e+196)
                                  		tmp = Float64(fma(log(c), Float64(b - 0.5), Float64(i * y)) + t);
                                  	elseif (Float64(b - 0.5) <= 2e+160)
                                  		tmp = Float64(fma(i, y, fma(-0.5, log(c), z)) + a);
                                  	else
                                  		tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a);
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b - 0.5), $MachinePrecision], -1e+196], N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[N[(b - 0.5), $MachinePrecision], 2e+160], N[(N[(i * y + N[(-0.5 * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+196}:\\
                                  \;\;\;\;\mathsf{fma}\left(\log c, b - 0.5, i \cdot y\right) + t\\
                                  
                                  \mathbf{elif}\;b - 0.5 \leq 2 \cdot 10^{+160}:\\
                                  \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if (-.f64 b #s(literal 1/2 binary64)) < -9.9999999999999995e195

                                    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 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. 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) \]
                                      4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -9.9999999999999995e195 < (-.f64 b #s(literal 1/2 binary64)) < 2.00000000000000001e160

                                        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 t around 0

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(i, y, z + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites61.5%

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

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

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

                                            if 2.00000000000000001e160 < (-.f64 b #s(literal 1/2 binary64))

                                            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 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. 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) \]
                                              4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 10: 63.1% accurate, 1.7× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\log c, b - 0.5, z\right)\\ \mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+196}:\\ \;\;\;\;t\_1 + a\\ \mathbf{elif}\;b - 0.5 \leq 2 \cdot 10^{+160}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\left(t\_1 + t\right) + a\\ \end{array} \end{array} \]
                                              (FPCore (x y z t a b c i)
                                               :precision binary64
                                               (let* ((t_1 (fma (log c) (- b 0.5) z)))
                                                 (if (<= (- b 0.5) -1e+196)
                                                   (+ t_1 a)
                                                   (if (<= (- b 0.5) 2e+160)
                                                     (+ (fma i y (fma -0.5 (log c) z)) a)
                                                     (+ (+ t_1 t) a)))))
                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                              	double t_1 = fma(log(c), (b - 0.5), z);
                                              	double tmp;
                                              	if ((b - 0.5) <= -1e+196) {
                                              		tmp = t_1 + a;
                                              	} else if ((b - 0.5) <= 2e+160) {
                                              		tmp = fma(i, y, fma(-0.5, log(c), z)) + a;
                                              	} else {
                                              		tmp = (t_1 + t) + a;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(x, y, z, t, a, b, c, i)
                                              	t_1 = fma(log(c), Float64(b - 0.5), z)
                                              	tmp = 0.0
                                              	if (Float64(b - 0.5) <= -1e+196)
                                              		tmp = Float64(t_1 + a);
                                              	elseif (Float64(b - 0.5) <= 2e+160)
                                              		tmp = Float64(fma(i, y, fma(-0.5, log(c), z)) + a);
                                              	else
                                              		tmp = Float64(Float64(t_1 + t) + a);
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[N[(b - 0.5), $MachinePrecision], -1e+196], N[(t$95$1 + a), $MachinePrecision], If[LessEqual[N[(b - 0.5), $MachinePrecision], 2e+160], N[(N[(i * y + N[(-0.5 * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(t$95$1 + t), $MachinePrecision] + a), $MachinePrecision]]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              t_1 := \mathsf{fma}\left(\log c, b - 0.5, z\right)\\
                                              \mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+196}:\\
                                              \;\;\;\;t\_1 + a\\
                                              
                                              \mathbf{elif}\;b - 0.5 \leq 2 \cdot 10^{+160}:\\
                                              \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\left(t\_1 + t\right) + a\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if (-.f64 b #s(literal 1/2 binary64)) < -9.9999999999999995e195

                                                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 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. 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) \]
                                                  4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if -9.9999999999999995e195 < (-.f64 b #s(literal 1/2 binary64)) < 2.00000000000000001e160

                                                      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 t around 0

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

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

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

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

                                                        \[\leadsto \mathsf{fma}\left(i, y, z + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites61.5%

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

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

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

                                                          if 2.00000000000000001e160 < (-.f64 b #s(literal 1/2 binary64))

                                                          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 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. 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) \]
                                                            4. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            Alternative 11: 79.8% accurate, 1.8× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+181} \lor \neg \left(x \leq 3.8 \cdot 10^{+53}\right):\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\ \end{array} \end{array} \]
                                                            (FPCore (x y z t a b c i)
                                                             :precision binary64
                                                             (if (or (<= x -6.4e+181) (not (<= x 3.8e+53)))
                                                               (+ (fma i y (fma (log y) x (* 1.0 z))) a)
                                                               (+ (fma i y (fma (log c) (- b 0.5) z)) a)))
                                                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                            	double tmp;
                                                            	if ((x <= -6.4e+181) || !(x <= 3.8e+53)) {
                                                            		tmp = fma(i, y, fma(log(y), x, (1.0 * z))) + a;
                                                            	} else {
                                                            		tmp = fma(i, y, fma(log(c), (b - 0.5), z)) + a;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            function code(x, y, z, t, a, b, c, i)
                                                            	tmp = 0.0
                                                            	if ((x <= -6.4e+181) || !(x <= 3.8e+53))
                                                            		tmp = Float64(fma(i, y, fma(log(y), x, Float64(1.0 * z))) + a);
                                                            	else
                                                            		tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), z)) + a);
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -6.4e+181], N[Not[LessEqual[x, 3.8e+53]], $MachinePrecision]], N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(1.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;x \leq -6.4 \cdot 10^{+181} \lor \neg \left(x \leq 3.8 \cdot 10^{+53}\right):\\
                                                            \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if x < -6.4000000000000001e181 or 3.79999999999999997e53 < x

                                                              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 t around 0

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

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

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

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

                                                                \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, z \cdot \left(1 + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{z}\right)\right)\right) + a \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites84.0%

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

                                                                  \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites84.0%

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

                                                                  if -6.4000000000000001e181 < x < 3.79999999999999997e53

                                                                  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 t around 0

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

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

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

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

                                                                    \[\leadsto \mathsf{fma}\left(i, y, z + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites75.5%

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

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+181} \lor \neg \left(x \leq 3.8 \cdot 10^{+53}\right):\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, 1 \cdot z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\ \end{array} \]
                                                                  10. Add Preprocessing

                                                                  Alternative 12: 73.5% accurate, 1.8× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+183} \lor \neg \left(x \leq 4.4 \cdot 10^{+260}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\ \end{array} \end{array} \]
                                                                  (FPCore (x y z t a b c i)
                                                                   :precision binary64
                                                                   (if (or (<= x -5.8e+183) (not (<= x 4.4e+260)))
                                                                     (* (log y) x)
                                                                     (+ (fma i y (fma (log c) (- b 0.5) z)) a)))
                                                                  double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                  	double tmp;
                                                                  	if ((x <= -5.8e+183) || !(x <= 4.4e+260)) {
                                                                  		tmp = log(y) * x;
                                                                  	} else {
                                                                  		tmp = fma(i, y, fma(log(c), (b - 0.5), z)) + a;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(x, y, z, t, a, b, c, i)
                                                                  	tmp = 0.0
                                                                  	if ((x <= -5.8e+183) || !(x <= 4.4e+260))
                                                                  		tmp = Float64(log(y) * x);
                                                                  	else
                                                                  		tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), z)) + a);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -5.8e+183], N[Not[LessEqual[x, 4.4e+260]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;x \leq -5.8 \cdot 10^{+183} \lor \neg \left(x \leq 4.4 \cdot 10^{+260}\right):\\
                                                                  \;\;\;\;\log y \cdot x\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 2 regimes
                                                                  2. if x < -5.8000000000000001e183 or 4.40000000000000023e260 < 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 t around 0

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

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

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

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

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

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

                                                                        \[\leadsto \color{blue}{\log y \cdot x} \]
                                                                      3. lower-log.f6474.2

                                                                        \[\leadsto \color{blue}{\log y} \cdot x \]
                                                                    8. Applied rewrites74.2%

                                                                      \[\leadsto \color{blue}{\log y \cdot x} \]

                                                                    if -5.8000000000000001e183 < x < 4.40000000000000023e260

                                                                    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 t around 0

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

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

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

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

                                                                      \[\leadsto \mathsf{fma}\left(i, y, z + \log c \cdot \left(b - \frac{1}{2}\right)\right) + a \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites73.1%

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

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+183} \lor \neg \left(x \leq 4.4 \cdot 10^{+260}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\ \end{array} \]
                                                                    10. Add Preprocessing

                                                                    Alternative 13: 31.3% accurate, 2.0× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+196}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                                    (FPCore (x y z t a b c i)
                                                                     :precision binary64
                                                                     (if (or (<= x -8e+181) (not (<= x 4.5e+196))) (* (log y) x) (* i y)))
                                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double tmp;
                                                                    	if ((x <= -8e+181) || !(x <= 4.5e+196)) {
                                                                    		tmp = log(y) * x;
                                                                    	} else {
                                                                    		tmp = i * y;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    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
                                                                        real(8) :: tmp
                                                                        if ((x <= (-8d+181)) .or. (.not. (x <= 4.5d+196))) then
                                                                            tmp = log(y) * x
                                                                        else
                                                                            tmp = i * y
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double tmp;
                                                                    	if ((x <= -8e+181) || !(x <= 4.5e+196)) {
                                                                    		tmp = Math.log(y) * x;
                                                                    	} else {
                                                                    		tmp = i * y;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(x, y, z, t, a, b, c, i):
                                                                    	tmp = 0
                                                                    	if (x <= -8e+181) or not (x <= 4.5e+196):
                                                                    		tmp = math.log(y) * x
                                                                    	else:
                                                                    		tmp = i * y
                                                                    	return tmp
                                                                    
                                                                    function code(x, y, z, t, a, b, c, i)
                                                                    	tmp = 0.0
                                                                    	if ((x <= -8e+181) || !(x <= 4.5e+196))
                                                                    		tmp = Float64(log(y) * x);
                                                                    	else
                                                                    		tmp = Float64(i * y);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                    	tmp = 0.0;
                                                                    	if ((x <= -8e+181) || ~((x <= 4.5e+196)))
                                                                    		tmp = log(y) * x;
                                                                    	else
                                                                    		tmp = i * y;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8e+181], N[Not[LessEqual[x, 4.5e+196]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(i * y), $MachinePrecision]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;x \leq -8 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+196}\right):\\
                                                                    \;\;\;\;\log y \cdot x\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;i \cdot y\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if x < -7.9999999999999993e181 or 4.49999999999999978e196 < 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 t around 0

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

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

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

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

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

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

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

                                                                          \[\leadsto \color{blue}{\log y} \cdot x \]
                                                                      8. Applied rewrites65.5%

                                                                        \[\leadsto \color{blue}{\log y \cdot x} \]

                                                                      if -7.9999999999999993e181 < x < 4.49999999999999978e196

                                                                      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. lower-*.f6428.7

                                                                          \[\leadsto \color{blue}{i \cdot y} \]
                                                                      5. Applied rewrites28.7%

                                                                        \[\leadsto \color{blue}{i \cdot y} \]
                                                                    3. Recombined 2 regimes into one program.
                                                                    4. Final simplification35.8%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+196}\right):\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \]
                                                                    5. Add Preprocessing

                                                                    Alternative 14: 27.7% accurate, 10.2× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.6 \cdot 10^{-103}:\\ \;\;\;\;\frac{a}{i} \cdot i\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \end{array} \]
                                                                    (FPCore (x y z t a b c i)
                                                                     :precision binary64
                                                                     (if (<= y 3.6e-103) (* (/ a i) i) (* i y)))
                                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double tmp;
                                                                    	if (y <= 3.6e-103) {
                                                                    		tmp = (a / i) * i;
                                                                    	} else {
                                                                    		tmp = i * y;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    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
                                                                        real(8) :: tmp
                                                                        if (y <= 3.6d-103) then
                                                                            tmp = (a / i) * i
                                                                        else
                                                                            tmp = i * y
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                    	double tmp;
                                                                    	if (y <= 3.6e-103) {
                                                                    		tmp = (a / i) * i;
                                                                    	} else {
                                                                    		tmp = i * y;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(x, y, z, t, a, b, c, i):
                                                                    	tmp = 0
                                                                    	if y <= 3.6e-103:
                                                                    		tmp = (a / i) * i
                                                                    	else:
                                                                    		tmp = i * y
                                                                    	return tmp
                                                                    
                                                                    function code(x, y, z, t, a, b, c, i)
                                                                    	tmp = 0.0
                                                                    	if (y <= 3.6e-103)
                                                                    		tmp = Float64(Float64(a / i) * i);
                                                                    	else
                                                                    		tmp = Float64(i * y);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                    	tmp = 0.0;
                                                                    	if (y <= 3.6e-103)
                                                                    		tmp = (a / i) * i;
                                                                    	else
                                                                    		tmp = i * y;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 3.6e-103], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;y \leq 3.6 \cdot 10^{-103}:\\
                                                                    \;\;\;\;\frac{a}{i} \cdot i\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;i \cdot y\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if y < 3.5999999999999998e-103

                                                                      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 i around inf

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \frac{a}{i} \cdot i \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites8.9%

                                                                          \[\leadsto \frac{a}{i} \cdot i \]

                                                                        if 3.5999999999999998e-103 < y

                                                                        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. lower-*.f6436.7

                                                                            \[\leadsto \color{blue}{i \cdot y} \]
                                                                        5. Applied rewrites36.7%

                                                                          \[\leadsto \color{blue}{i \cdot y} \]
                                                                      8. Recombined 2 regimes into one program.
                                                                      9. Add Preprocessing

                                                                      Alternative 15: 23.7% 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. lower-*.f6426.7

                                                                          \[\leadsto \color{blue}{i \cdot y} \]
                                                                      5. Applied rewrites26.7%

                                                                        \[\leadsto \color{blue}{i \cdot y} \]
                                                                      6. Add Preprocessing

                                                                      Reproduce

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