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

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

\\
i \cdot y + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, a\right) + \left(z + t\right)\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 29.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right)\right) + i \cdot y\\ \mathbf{if}\;t\_1 \leq -100:\\ \;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\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
         (+
          (+ (* (- b 0.5) (log c)) (+ (+ (+ (* x (log y)) z) t) a))
          (* i y))))
   (if (<= t_1 -100.0)
     (fma (/ (* i y) z) z z)
     (if (<= t_1 INFINITY) (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 = (((b - 0.5) * log(c)) + ((((x * log(y)) + z) + t) + a)) + (i * y);
	double tmp;
	if (t_1 <= -100.0) {
		tmp = fma(((i * y) / z), z, z);
	} else if (t_1 <= ((double) INFINITY)) {
		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(Float64(Float64(b - 0.5) * log(c)) + Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a)) + Float64(i * y))
	tmp = 0.0
	if (t_1 <= -100.0)
		tmp = fma(Float64(Float64(i * y) / z), z, z);
	elseif (t_1 <= Inf)
		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[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -100.0], N[(N[(N[(i * y), $MachinePrecision] / z), $MachinePrecision] * z + z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(a / z), $MachinePrecision] * z + z), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\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)) < -100

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, 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 rewrites34.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, 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 rewrites28.1%

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

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

        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}{i \cdot y} \]
        4. Step-by-step derivation
          1. lower-*.f6423.3

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

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

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

      Alternative 3: 30.2% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right)\right) + i \cdot y\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;i \cdot y\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\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
               (+
                (+ (* (- b 0.5) (log c)) (+ (+ (+ (* x (log y)) z) t) a))
                (* i y))))
         (if (<= t_1 (- INFINITY))
           (* i y)
           (if (<= t_1 INFINITY) (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 = (((b - 0.5) * log(c)) + ((((x * log(y)) + z) + t) + a)) + (i * y);
      	double tmp;
      	if (t_1 <= -((double) INFINITY)) {
      		tmp = i * y;
      	} else if (t_1 <= ((double) INFINITY)) {
      		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(Float64(Float64(b - 0.5) * log(c)) + Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a)) + Float64(i * y))
      	tmp = 0.0
      	if (t_1 <= Float64(-Inf))
      		tmp = Float64(i * y);
      	elseif (t_1 <= Inf)
      		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[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(a / z), $MachinePrecision] * z + z), $MachinePrecision], N[(i * y), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(\left(b - 0.5\right) \cdot \log c + \left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right)\right) + i \cdot y\\
      \mathbf{if}\;t\_1 \leq -\infty:\\
      \;\;\;\;i \cdot y\\
      
      \mathbf{elif}\;t\_1 \leq \infty:\\
      \;\;\;\;\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)) < -inf.0 or +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))

        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} \]

        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)) < +inf.0

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, 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 rewrites28.1%

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

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

        Alternative 4: 31.9% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, 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 rewrites34.5%

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

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

            1. Initial program 99.8%

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

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

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

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

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

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

                \[\leadsto \left(\frac{z}{x} + \log y\right) \cdot x + y \cdot i \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{z}{x} + \log y\right) \cdot x + y \cdot i} \]
                2. +-commutativeN/A

                  \[\leadsto \color{blue}{y \cdot i + \left(\frac{z}{x} + \log y\right) \cdot x} \]
                3. lift-*.f64N/A

                  \[\leadsto \color{blue}{y \cdot i} + \left(\frac{z}{x} + \log y\right) \cdot x \]
                4. lower-fma.f6442.2

                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\frac{z}{x} + \log y\right) \cdot x\right)} \]
              3. Applied rewrites42.2%

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

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

                  \[\leadsto \mathsf{fma}\left(y, i, \frac{a}{x} \cdot x\right) \]
              6. Recombined 2 regimes into one program.
              7. Final simplification31.5%

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

              Alternative 5: 91.9% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\ \mathbf{if}\;x \leq -9.5 \cdot 10^{+121}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+196}:\\ \;\;\;\;\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 (- b 0.5) (log c) (fma (log y) x z)) (+ a t))))
                 (if (<= x -9.5e+121)
                   t_1
                   (if (<= x 1.75e+196)
                     (+ (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((b - 0.5), log(c), fma(log(y), x, z)) + (a + t);
              	double tmp;
              	if (x <= -9.5e+121) {
              		tmp = t_1;
              	} else if (x <= 1.75e+196) {
              		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(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(a + t))
              	tmp = 0.0
              	if (x <= -9.5e+121)
              		tmp = t_1;
              	elseif (x <= 1.75e+196)
              		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[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+121], t$95$1, If[LessEqual[x, 1.75e+196], 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(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\
              \mathbf{if}\;x \leq -9.5 \cdot 10^{+121}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;x \leq 1.75 \cdot 10^{+196}:\\
              \;\;\;\;\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 < -9.49999999999999949e121 or 1.7499999999999999e196 < x

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

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

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

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

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

                    \[\leadsto \left(a + t\right) + \color{blue}{\left(\left(z + x \cdot \log 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 + x \cdot \log 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 + x \cdot \log 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 + x \cdot \log y\right)} \]
                  8. lower--.f64N/A

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

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

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

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

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

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

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

                if -9.49999999999999949e121 < x < 1.7499999999999999e196

                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(a + t\right) + \mathsf{fma}\left(b - \frac{1}{2}, \log c, \color{blue}{i \cdot y + z}\right) \]
                  11. lower-fma.f6497.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 rewrites97.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 simplification94.6%

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

              Alternative 6: 43.3% accurate, 1.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{a}{z}, z, z\right)\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+170}:\\ \;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+126}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+48}:\\ \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t a b c i)
               :precision binary64
               (let* ((t_1 (fma (/ a z) z z)))
                 (if (<= z -1.85e+170)
                   (fma (/ (* i y) z) z z)
                   (if (<= z -1.9e+126)
                     t_1
                     (if (<= z -1.8e+48)
                       (fma y i (* x (log y)))
                       (if (<= z -6.6e+22)
                         t_1
                         (if (<= z 5.6e-67) (fma y i (* b (log c))) t_1)))))))
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = fma((a / z), z, z);
              	double tmp;
              	if (z <= -1.85e+170) {
              		tmp = fma(((i * y) / z), z, z);
              	} else if (z <= -1.9e+126) {
              		tmp = t_1;
              	} else if (z <= -1.8e+48) {
              		tmp = fma(y, i, (x * log(y)));
              	} else if (z <= -6.6e+22) {
              		tmp = t_1;
              	} else if (z <= 5.6e-67) {
              		tmp = fma(y, i, (b * log(c)));
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b, c, i)
              	t_1 = fma(Float64(a / z), z, z)
              	tmp = 0.0
              	if (z <= -1.85e+170)
              		tmp = fma(Float64(Float64(i * y) / z), z, z);
              	elseif (z <= -1.9e+126)
              		tmp = t_1;
              	elseif (z <= -1.8e+48)
              		tmp = fma(y, i, Float64(x * log(y)));
              	elseif (z <= -6.6e+22)
              		tmp = t_1;
              	elseif (z <= 5.6e-67)
              		tmp = fma(y, i, Float64(b * log(c)));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a / z), $MachinePrecision] * z + z), $MachinePrecision]}, If[LessEqual[z, -1.85e+170], N[(N[(N[(i * y), $MachinePrecision] / z), $MachinePrecision] * z + z), $MachinePrecision], If[LessEqual[z, -1.9e+126], t$95$1, If[LessEqual[z, -1.8e+48], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.6e+22], t$95$1, If[LessEqual[z, 5.6e-67], N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \mathsf{fma}\left(\frac{a}{z}, z, z\right)\\
              \mathbf{if}\;z \leq -1.85 \cdot 10^{+170}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right)\\
              
              \mathbf{elif}\;z \leq -1.9 \cdot 10^{+126}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;z \leq -1.8 \cdot 10^{+48}:\\
              \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
              
              \mathbf{elif}\;z \leq -6.6 \cdot 10^{+22}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;z \leq 5.6 \cdot 10^{-67}:\\
              \;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if z < -1.84999999999999994e170

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, 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 rewrites59.7%

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

                  if -1.84999999999999994e170 < z < -1.90000000000000008e126 or -1.79999999999999992e48 < z < -6.5999999999999996e22 or 5.60000000000000021e-67 < z

                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(i, y, \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, 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 rewrites39.7%

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

                    if -1.90000000000000008e126 < z < -1.79999999999999992e48

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

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

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

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

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

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

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

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

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

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

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

                    if -6.5999999999999996e22 < z < 5.60000000000000021e-67

                    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 inf

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

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

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

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

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

                        \[\leadsto \left(\frac{z}{x} + \log y\right) \cdot x + y \cdot i \]
                      2. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto \color{blue}{\left(\frac{z}{x} + \log y\right) \cdot x + y \cdot i} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{y \cdot i + \left(\frac{z}{x} + \log y\right) \cdot x} \]
                        3. lift-*.f64N/A

                          \[\leadsto \color{blue}{y \cdot i} + \left(\frac{z}{x} + \log y\right) \cdot x \]
                        4. lower-fma.f6445.5

                          \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\frac{z}{x} + \log y\right) \cdot x\right)} \]
                      3. Applied rewrites45.5%

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

                        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{b \cdot \log c}\right) \]
                      5. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\log c \cdot b}\right) \]
                        2. lower-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\log c \cdot b}\right) \]
                        3. lower-log.f6447.9

                          \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\log c} \cdot b\right) \]
                      6. Applied rewrites47.9%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+170}:\\ \;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{z}, z, z\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a}{z}, z, z\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+48}:\\ \;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a}{z}, z, z\right)\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{a}{z}, z, z\right)\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 7: 90.4% accurate, 1.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\ \mathbf{if}\;x \leq -8.5 \cdot 10^{+234}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+194}:\\ \;\;\;\;\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 y i (* (+ (/ a x) (log y)) x))))
                       (if (<= x -8.5e+234)
                         t_1
                         (if (<= x 2.3e+194)
                           (+ (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(y, i, (((a / x) + log(y)) * x));
                    	double tmp;
                    	if (x <= -8.5e+234) {
                    		tmp = t_1;
                    	} else if (x <= 2.3e+194) {
                    		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 = fma(y, i, Float64(Float64(Float64(a / x) + log(y)) * x))
                    	tmp = 0.0
                    	if (x <= -8.5e+234)
                    		tmp = t_1;
                    	elseif (x <= 2.3e+194)
                    		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[(y * i + N[(N[(N[(a / x), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+234], t$95$1, If[LessEqual[x, 2.3e+194], 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(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\
                    \mathbf{if}\;x \leq -8.5 \cdot 10^{+234}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;x \leq 2.3 \cdot 10^{+194}:\\
                    \;\;\;\;\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 < -8.49999999999999989e234 or 2.30000000000000005e194 < x

                      1. Initial program 99.5%

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

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

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

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

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

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

                          \[\leadsto \left(\frac{z}{x} + \log y\right) \cdot x + y \cdot i \]
                        2. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \color{blue}{\left(\frac{z}{x} + \log y\right) \cdot x + y \cdot i} \]
                          2. +-commutativeN/A

                            \[\leadsto \color{blue}{y \cdot i + \left(\frac{z}{x} + \log y\right) \cdot x} \]
                          3. lift-*.f64N/A

                            \[\leadsto \color{blue}{y \cdot i} + \left(\frac{z}{x} + \log y\right) \cdot x \]
                          4. lower-fma.f6482.1

                            \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\frac{z}{x} + \log y\right) \cdot x\right)} \]
                        3. Applied rewrites82.1%

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

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

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

                          if -8.49999999999999989e234 < x < 2.30000000000000005e194

                          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.f6493.2

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+234}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+194}:\\ \;\;\;\;\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(y, i, \left(\frac{a}{x} + \log y\right) \cdot x\right)\\ \end{array} \]
                        8. Add Preprocessing

                        Alternative 8: 89.3% accurate, 1.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+246}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+218}:\\ \;\;\;\;\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 y i (* x (log y)))))
                           (if (<= x -6.8e+246)
                             t_1
                             (if (<= x 2.6e+218)
                               (+ (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(y, i, (x * log(y)));
                        	double tmp;
                        	if (x <= -6.8e+246) {
                        		tmp = t_1;
                        	} else if (x <= 2.6e+218) {
                        		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 = fma(y, i, Float64(x * log(y)))
                        	tmp = 0.0
                        	if (x <= -6.8e+246)
                        		tmp = t_1;
                        	elseif (x <= 2.6e+218)
                        		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[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+246], t$95$1, If[LessEqual[x, 2.6e+218], 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(y, i, x \cdot \log y\right)\\
                        \mathbf{if}\;x \leq -6.8 \cdot 10^{+246}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;x \leq 2.6 \cdot 10^{+218}:\\
                        \;\;\;\;\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.79999999999999977e246 or 2.60000000000000002e218 < x

                          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

                          if -6.79999999999999977e246 < x < 2.60000000000000002e218

                          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.f6491.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 rewrites91.9%

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

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

                        Alternative 9: 23.9% accurate, 39.0× speedup?

                        \[\begin{array}{l} \\ i \cdot y \end{array} \]
                        (FPCore (x y z t a b c i) :precision binary64 (* i y))
                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	return i * y;
                        }
                        
                        real(8) function code(x, y, z, t, a, b, c, i)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8), intent (in) :: a
                            real(8), intent (in) :: b
                            real(8), intent (in) :: c
                            real(8), intent (in) :: i
                            code = i * y
                        end function
                        
                        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                        	return i * y;
                        }
                        
                        def code(x, y, z, t, a, b, c, i):
                        	return i * y
                        
                        function code(x, y, z, t, a, b, c, i)
                        	return Float64(i * y)
                        end
                        
                        function tmp = code(x, y, z, t, a, b, c, i)
                        	tmp = i * y;
                        end
                        
                        code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        i \cdot y
                        \end{array}
                        
                        Derivation
                        1. Initial program 99.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}{i \cdot y} \]
                        4. Step-by-step derivation
                          1. lower-*.f6423.3

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

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

                        Reproduce

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