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

Percentage Accurate: 99.8% → 99.8%
Time: 10.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} \\ i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
}
def code(x, y, z, t, a, b, c, i):
	return (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x))))))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Add Preprocessing
  3. Final simplification99.9%

    \[\leadsto i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right) \]
  4. Add Preprocessing

Alternative 2: 22.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\

\mathbf{elif}\;t\_1 \leq -5000:\\
\;\;\;\;\frac{z}{y} \cdot y\\

\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{a}{y} \cdot y\\

\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 1e303 < (+.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-*.f6485.7

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

      \[\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)) < -5e3

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

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

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

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

      \[\leadsto \frac{z}{y} \cdot y \]
    7. Step-by-step derivation
      1. Applied rewrites14.7%

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

      if -5e3 < (+.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)) < 1e303

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

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

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

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

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

        \[\leadsto \frac{a}{y} \cdot y \]
      7. Step-by-step derivation
        1. Applied rewrites13.2%

          \[\leadsto \frac{a}{y} \cdot y \]
      8. Recombined 3 regimes into one program.
      9. Final simplification25.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right) \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right) \leq -5000:\\ \;\;\;\;\frac{z}{y} \cdot y\\ \mathbf{elif}\;i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right) \leq 10^{+303}:\\ \;\;\;\;\frac{a}{y} \cdot y\\ \mathbf{else}:\\ \;\;\;\;i \cdot y\\ \end{array} \]
      10. Add Preprocessing

      Alternative 3: 73.3% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

          if -1.9999999999999999e304 < (+.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)) < 1e308

          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.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 rewrites82.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 y around 0

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

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

            if 1e308 < (+.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-*.f6495.0

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

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

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

          Alternative 4: 58.5% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

              if -1.0000000000000001e302 < (+.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)) < 1e308

              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.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 y around 0

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

                  \[\leadsto \left(a + z\right) + \color{blue}{\mathsf{fma}\left(\log c, -0.5 + b, \log y \cdot x\right)} \]
                2. Taylor expanded in x 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 rewrites54.8%

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

                  if 1e308 < (+.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-*.f6495.0

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

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

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

                Alternative 5: 35.9% accurate, 0.5× speedup?

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

                  1. Initial program 99.9%

                    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                  2. Add Preprocessing
                  3. Taylor expanded in z around inf

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

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

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

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

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

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

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

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

                    if -5.00000000000000029e62 < (+.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)) < 1e308

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{a}{z}, z, z\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites31.2%

                        \[\leadsto \mathsf{fma}\left(\frac{a}{z}, z, z\right) \]

                      if 1e308 < (+.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-*.f6495.0

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

                        \[\leadsto \color{blue}{i \cdot y} \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification38.6%

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

                    Alternative 6: 37.5% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{a}{z}, z, z\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites31.1%

                          \[\leadsto \mathsf{fma}\left(\frac{a}{z}, z, z\right) \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification39.9%

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

                      Alternative 7: 79.4% accurate, 0.5× speedup?

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

                        1. Initial program 100.0%

                          \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around 0

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

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

                            \[\leadsto \color{blue}{\left(a + t\right) + \left(z + \left(i \cdot y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
                          3. 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.f6492.0

                            \[\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 rewrites92.0%

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

                        if -1e167 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.0000000000000002e148

                        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.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 b around 0

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

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

                          if 4.0000000000000002e148 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

                          1. Initial program 99.6%

                            \[\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.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 y around 0

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

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

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

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

                            Alternative 8: 62.3% accurate, 0.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\log c, b - 0.5, z\right)\\ t_2 := \log c \cdot \left(b - 0.5\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+221}:\\ \;\;\;\;\left(t\_1 + t\right) + a\\ \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;t\_1 + 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)) (t_2 (* (log c) (- b 0.5))))
                               (if (<= t_2 -1e+221)
                                 (+ (+ t_1 t) a)
                                 (if (<= t_2 4e+148) (+ (fma i y (fma -0.5 (log c) z)) a) (+ t_1 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 t_2 = log(c) * (b - 0.5);
                            	double tmp;
                            	if (t_2 <= -1e+221) {
                            		tmp = (t_1 + t) + a;
                            	} else if (t_2 <= 4e+148) {
                            		tmp = fma(i, y, fma(-0.5, log(c), z)) + a;
                            	} else {
                            		tmp = t_1 + a;
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, t, a, b, c, i)
                            	t_1 = fma(log(c), Float64(b - 0.5), z)
                            	t_2 = Float64(log(c) * Float64(b - 0.5))
                            	tmp = 0.0
                            	if (t_2 <= -1e+221)
                            		tmp = Float64(Float64(t_1 + t) + a);
                            	elseif (t_2 <= 4e+148)
                            		tmp = Float64(fma(i, y, fma(-0.5, log(c), z)) + a);
                            	else
                            		tmp = Float64(t_1 + 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]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+221], N[(N[(t$95$1 + t), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$2, 4e+148], N[(N[(i * y + N[(-0.5 * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(t$95$1 + a), $MachinePrecision]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \mathsf{fma}\left(\log c, b - 0.5, z\right)\\
                            t_2 := \log c \cdot \left(b - 0.5\right)\\
                            \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+221}:\\
                            \;\;\;\;\left(t\_1 + t\right) + a\\
                            
                            \mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+148}:\\
                            \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(-0.5, \log c, z\right)\right) + a\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_1 + a\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1e221

                              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.f6496.8

                                  \[\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 rewrites96.8%

                                \[\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 y around 0

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

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

                                if -1e221 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.0000000000000002e148

                                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 rewrites82.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 rewrites64.8%

                                    \[\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 rewrites61.3%

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

                                    if 4.0000000000000002e148 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

                                    1. Initial program 99.6%

                                      \[\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.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 y around 0

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

                                        \[\leadsto \left(a + z\right) + \color{blue}{\mathsf{fma}\left(\log c, -0.5 + b, \log y \cdot x\right)} \]
                                      2. Taylor expanded in x 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 rewrites81.0%

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

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

                                      Alternative 9: 90.9% accurate, 1.0× speedup?

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

                                        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 rewrites89.5%

                                          \[\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 0

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

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

                                          if -2.5000000000000001e137 < x < 3e52

                                          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.f6498.3

                                              \[\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 rewrites98.3%

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

                                          if 3e52 < 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 rewrites95.4%

                                            \[\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 \mathsf{fma}\left(i, y, x \cdot \left(\log y + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{x}\right)\right)\right) + a \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites95.4%

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

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

                                                \[\leadsto \mathsf{fma}\left(i, y, \left(\frac{z}{x} + \log y\right) \cdot x\right) + a \]
                                            4. Recombined 3 regimes into one program.
                                            5. Final simplification94.6%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+137}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \left(-0.5 + b\right) \cdot \log c\right)\right) + a\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \left(\frac{z}{x} + \log y\right) \cdot x\right) + a\\ \end{array} \]
                                            6. Add Preprocessing

                                            Alternative 10: 84.4% 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 rewrites84.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. Add Preprocessing

                                            Alternative 11: 89.5% accurate, 1.7× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, \left(\frac{z}{x} + \log y\right) \cdot x\right) + a\\ \mathbf{if}\;x \leq -4.8 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b c i)
                                             :precision binary64
                                             (let* ((t_1 (+ (fma i y (* (+ (/ z x) (log y)) x)) a)))
                                               (if (<= x -4.8e+45)
                                                 t_1
                                                 (if (<= x 3e+52) (+ (fma (- b 0.5) (log c) (fma i y z)) (+ a t)) t_1))))
                                            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                            	double t_1 = fma(i, y, (((z / x) + log(y)) * x)) + a;
                                            	double tmp;
                                            	if (x <= -4.8e+45) {
                                            		tmp = t_1;
                                            	} else if (x <= 3e+52) {
                                            		tmp = fma((b - 0.5), log(c), fma(i, y, z)) + (a + t);
                                            	} else {
                                            		tmp = t_1;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a, b, c, i)
                                            	t_1 = Float64(fma(i, y, Float64(Float64(Float64(z / x) + log(y)) * x)) + a)
                                            	tmp = 0.0
                                            	if (x <= -4.8e+45)
                                            		tmp = t_1;
                                            	elseif (x <= 3e+52)
                                            		tmp = Float64(fma(Float64(b - 0.5), log(c), fma(i, y, z)) + Float64(a + t));
                                            	else
                                            		tmp = t_1;
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y + N[(N[(N[(z / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[x, -4.8e+45], t$95$1, If[LessEqual[x, 3e+52], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_1 := \mathsf{fma}\left(i, y, \left(\frac{z}{x} + \log y\right) \cdot x\right) + a\\
                                            \mathbf{if}\;x \leq -4.8 \cdot 10^{+45}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            \mathbf{elif}\;x \leq 3 \cdot 10^{+52}:\\
                                            \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if x < -4.79999999999999979e45 or 3e52 < 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 rewrites92.6%

                                                \[\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 \mathsf{fma}\left(i, y, x \cdot \left(\log y + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{x}\right)\right)\right) + a \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites92.6%

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

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

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

                                                  if -4.79999999999999979e45 < x < 3e52

                                                  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.f6499.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 rewrites99.9%

                                                    \[\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 simplification92.9%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \left(\frac{z}{x} + \log y\right) \cdot x\right) + a\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \left(\frac{z}{x} + \log y\right) \cdot x\right) + a\\ \end{array} \]
                                                6. Add Preprocessing

                                                Alternative 12: 88.2% accurate, 1.7× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -6 \cdot 10^{+241}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.56 \cdot 10^{+193}:\\ \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                (FPCore (x y z t a b c i)
                                                 :precision binary64
                                                 (let* ((t_1 (* (log y) x)))
                                                   (if (<= x -6e+241)
                                                     t_1
                                                     (if (<= x 1.56e+193)
                                                       (+ (fma (- b 0.5) (log c) (fma i y z)) (+ a t))
                                                       t_1))))
                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                	double t_1 = log(y) * x;
                                                	double tmp;
                                                	if (x <= -6e+241) {
                                                		tmp = t_1;
                                                	} else if (x <= 1.56e+193) {
                                                		tmp = fma((b - 0.5), log(c), fma(i, y, z)) + (a + t);
                                                	} else {
                                                		tmp = t_1;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(x, y, z, t, a, b, c, i)
                                                	t_1 = Float64(log(y) * x)
                                                	tmp = 0.0
                                                	if (x <= -6e+241)
                                                		tmp = t_1;
                                                	elseif (x <= 1.56e+193)
                                                		tmp = Float64(fma(Float64(b - 0.5), log(c), fma(i, y, z)) + Float64(a + t));
                                                	else
                                                		tmp = t_1;
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6e+241], t$95$1, If[LessEqual[x, 1.56e+193], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_1 := \log y \cdot x\\
                                                \mathbf{if}\;x \leq -6 \cdot 10^{+241}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                \mathbf{elif}\;x \leq 1.56 \cdot 10^{+193}:\\
                                                \;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if x < -6.00000000000000031e241 or 1.5599999999999999e193 < 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 rewrites99.7%

                                                    \[\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.f6487.1

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

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

                                                  if -6.00000000000000031e241 < x < 1.5599999999999999e193

                                                  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.f6492.3

                                                      \[\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 rewrites92.3%

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

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

                                                Alternative 13: 73.8% accurate, 1.8× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -6 \cdot 10^{+241}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.56 \cdot 10^{+193}:\\ \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                (FPCore (x y z t a b c i)
                                                 :precision binary64
                                                 (let* ((t_1 (* (log y) x)))
                                                   (if (<= x -6e+241)
                                                     t_1
                                                     (if (<= x 1.56e+193) (+ (fma i y (fma (log c) (- b 0.5) z)) a) t_1))))
                                                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                	double t_1 = log(y) * x;
                                                	double tmp;
                                                	if (x <= -6e+241) {
                                                		tmp = t_1;
                                                	} else if (x <= 1.56e+193) {
                                                		tmp = fma(i, y, fma(log(c), (b - 0.5), z)) + a;
                                                	} else {
                                                		tmp = t_1;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(x, y, z, t, a, b, c, i)
                                                	t_1 = Float64(log(y) * x)
                                                	tmp = 0.0
                                                	if (x <= -6e+241)
                                                		tmp = t_1;
                                                	elseif (x <= 1.56e+193)
                                                		tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), z)) + a);
                                                	else
                                                		tmp = t_1;
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6e+241], t$95$1, If[LessEqual[x, 1.56e+193], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_1 := \log y \cdot x\\
                                                \mathbf{if}\;x \leq -6 \cdot 10^{+241}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                \mathbf{elif}\;x \leq 1.56 \cdot 10^{+193}:\\
                                                \;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if x < -6.00000000000000031e241 or 1.5599999999999999e193 < 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 rewrites99.7%

                                                    \[\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.f6487.1

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

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

                                                  if -6.00000000000000031e241 < x < 1.5599999999999999e193

                                                  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 rewrites82.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 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 rewrites74.6%

                                                      \[\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. Add Preprocessing

                                                  Alternative 14: 27.4% accurate, 8.1× speedup?

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

                                                    1. Initial program 99.9%

                                                      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in y around inf

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

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

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

                                                    if -6.79999999999999982 < i < 1.95e43

                                                    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}{y \cdot \left(i + \left(-1 \cdot \frac{x \cdot \log \left(\frac{1}{y}\right)}{y} + \left(\frac{a}{y} + \left(\frac{t}{y} + \left(\frac{z}{y} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{y}\right)\right)\right)\right)\right)} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

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

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

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

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

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

                                                    Alternative 15: 23.6% 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-*.f6423.4

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

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

                                                    Reproduce

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