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

Percentage Accurate: 99.9% → 99.9%
Time: 15.1s
Alternatives: 17
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 17 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.9% 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.9% accurate, 1.0× speedup?

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

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Derivation
  1. Initial program 99.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. Add Preprocessing

Alternative 2: 40.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, z\right)\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+226}:\\
\;\;\;\;a + b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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.0000000000000001e300

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified99.9%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6486.5

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

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

    if -1.0000000000000001e300 < (+.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)) < -3.9999999999999999e82

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6431.8

        \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    8. Simplified31.8%

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, z\right)} \]
      3. lower-log.f6438.7

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log y}, z\right) \]
    11. Simplified38.7%

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

    if -3.9999999999999999e82 < (+.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.99999999999999992e226

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{b \cdot \log c} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      2. lower-*.f64N/A

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      3. lower-log.f6441.9

        \[\leadsto a + \color{blue}{\log c} \cdot b \]
    8. Simplified41.9%

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

    if 1.99999999999999992e226 < (+.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.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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{i \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6456.1

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified56.1%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. lower-fma.f6456.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    11. Simplified56.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification49.0%

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

Alternative 3: 40.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, z\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+226}:\\
\;\;\;\;a + b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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)) < -4.9999999999999997e303

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6483.6

        \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    8. Simplified83.6%

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    9. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(i + \frac{z}{y}\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto y \cdot \color{blue}{\left(i + \frac{z}{y}\right)} \]
      3. lower-/.f6489.6

        \[\leadsto y \cdot \left(i + \color{blue}{\frac{z}{y}}\right) \]
    11. Simplified89.6%

      \[\leadsto \color{blue}{y \cdot \left(i + \frac{z}{y}\right)} \]

    if -4.9999999999999997e303 < (+.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)) < -3.9999999999999999e82

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6432.6

        \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    8. Simplified32.6%

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, z\right)} \]
      3. lower-log.f6439.2

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log y}, z\right) \]
    11. Simplified39.2%

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

    if -3.9999999999999999e82 < (+.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.99999999999999992e226

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{b \cdot \log c} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      2. lower-*.f64N/A

        \[\leadsto a + \color{blue}{\log c \cdot b} \]
      3. lower-log.f6441.9

        \[\leadsto a + \color{blue}{\log c} \cdot b \]
    8. Simplified41.9%

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

    if 1.99999999999999992e226 < (+.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.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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{i \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6456.1

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified56.1%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. lower-fma.f6456.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    11. Simplified56.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification48.7%

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

Alternative 4: 39.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -4.9999999999999997e303

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6483.6

        \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    8. Simplified83.6%

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    9. Taylor expanded in y around inf

      \[\leadsto \color{blue}{y \cdot \left(i + \frac{z}{y}\right)} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto y \cdot \color{blue}{\left(i + \frac{z}{y}\right)} \]
      3. lower-/.f6489.6

        \[\leadsto y \cdot \left(i + \color{blue}{\frac{z}{y}}\right) \]
    11. Simplified89.6%

      \[\leadsto \color{blue}{y \cdot \left(i + \frac{z}{y}\right)} \]

    if -4.9999999999999997e303 < (+.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.0000000000000001e85

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    7. Step-by-step derivation
      1. lower-/.f6430.3

        \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    8. Simplified30.3%

      \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{z}{x}}\right) \]
    9. Taylor expanded in x around 0

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, z\right)} \]
      3. lower-log.f6436.2

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log y}, z\right) \]
    11. Simplified36.2%

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

    if 5.0000000000000001e85 < (+.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 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{i \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6445.1

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified45.1%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. lower-fma.f6445.1

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    11. Simplified45.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 38.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -1 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a\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)) < -9.99999999999999958e27

    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 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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6430.7

        \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    8. Simplified30.7%

      \[\leadsto x \cdot \color{blue}{\frac{z}{x}} + y \cdot i \]
    9. Taylor expanded in x around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + z \]
      3. lower-fma.f6438.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, z\right)} \]
    11. Simplified38.9%

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

    if -9.99999999999999958e27 < (+.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 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified42.4%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. lower-fma.f6442.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    11. Simplified42.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 92.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+189}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.60000000000000016e118 or 5.5e189 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

    if -2.60000000000000016e118 < x < 5.5e189

    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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 90.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, b \cdot \log c\right)\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000016e118 or 5.5999999999999998e191 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \color{blue}{\log c} \cdot b\right)\right) \]
    11. Simplified86.7%

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

    if -2.90000000000000016e118 < x < 5.5999999999999998e191

    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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 83.7% accurate, 1.0× speedup?

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

\\
a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \log y, z\right)\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. 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. lower-+.f64N/A

      \[\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)} \]
    2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 88.1% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(i, y, x \cdot \log y\right)\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\ \;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log y + \frac{y \cdot i}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= x -2.9e+118)
   (fma i y (* x (log y)))
   (if (<= x 5.6e+191)
     (+ a (+ (fma i y z) (fma (log c) (+ b -0.5) t)))
     (* x (+ (log y) (/ (* y i) x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (x <= -2.9e+118) {
		tmp = fma(i, y, (x * log(y)));
	} else if (x <= 5.6e+191) {
		tmp = a + (fma(i, y, z) + fma(log(c), (b + -0.5), t));
	} else {
		tmp = x * (log(y) + ((y * i) / x));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (x <= -2.9e+118)
		tmp = fma(i, y, Float64(x * log(y)));
	elseif (x <= 5.6e+191)
		tmp = Float64(a + Float64(fma(i, y, z) + fma(log(c), Float64(b + -0.5), t)));
	else
		tmp = Float64(x * Float64(log(y) + Float64(Float64(y * i) / x)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.9e+118], N[(i * y + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.6e+191], N[(a + N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[y], $MachinePrecision] + N[(N[(y * i), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(i, y, x \cdot \log y\right)\\

\mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log y + \frac{y \cdot i}{x}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.90000000000000016e118

    1. Initial program 99.8%

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

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

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified86.0%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6475.1

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

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

    if -2.90000000000000016e118 < x < 5.5999999999999998e191

    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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999998e191 < 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 x around -inf

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(\log y + \frac{\color{blue}{i \cdot y}}{x}\right) \]
    7. Step-by-step derivation
      1. lower-*.f6492.4

        \[\leadsto x \cdot \left(\log y + \frac{\color{blue}{i \cdot y}}{x}\right) \]
    8. Simplified92.4%

      \[\leadsto x \cdot \left(\log y + \frac{\color{blue}{i \cdot y}}{x}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.8%

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

Alternative 10: 65.0% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -6.2 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(i, a \cdot \frac{y}{a}, a\right)\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+191}:\\
\;\;\;\;a + \left(t + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.60000000000000016e118 or 2.1000000000000001e191 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6481.9

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

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

    if -2.60000000000000016e118 < x < -6.1999999999999999e-61

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{i \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6465.2

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified65.2%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. lower-fma.f6465.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    11. Simplified65.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    12. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{i \cdot y}{a}\right)} \]
    13. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{i \cdot y}{a} \cdot a + 1 \cdot a} \]
      3. *-lft-identityN/A

        \[\leadsto \frac{i \cdot y}{a} \cdot a + \color{blue}{a} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{\left(i \cdot \frac{y}{a}\right)} \cdot a + a \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{i \cdot \left(\frac{y}{a} \cdot a\right)} + a \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, \frac{y}{a} \cdot a, a\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\frac{y}{a} \cdot a}, a\right) \]
      8. lower-/.f6462.8

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\frac{y}{a}} \cdot a, a\right) \]
    14. Simplified62.8%

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

    if -6.1999999999999999e-61 < x < 2.1000000000000001e191

    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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(\mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right) + t\right) \]
      7. sub-negN/A

        \[\leadsto a + \left(\mathsf{fma}\left(\log c, \color{blue}{b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, z\right) + t\right) \]
      8. metadata-evalN/A

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

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

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

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

Alternative 11: 88.1% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000016e118 or 5.5999999999999998e191 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6481.9

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

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

    if -2.90000000000000016e118 < x < 5.5999999999999998e191

    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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 53.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -6.2 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(i, a \cdot \frac{y}{a}, a\right)\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+191}:\\
\;\;\;\;a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.60000000000000016e118 or 2.1000000000000001e191 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6481.9

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

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

    if -2.60000000000000016e118 < x < -6.1999999999999999e-61

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a + \color{blue}{i \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6465.2

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified65.2%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + a \]
      3. lower-fma.f6465.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    11. Simplified65.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
    12. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{i \cdot y}{a}\right)} \]
    13. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{i \cdot y}{a} \cdot a + 1 \cdot a} \]
      3. *-lft-identityN/A

        \[\leadsto \frac{i \cdot y}{a} \cdot a + \color{blue}{a} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{\left(i \cdot \frac{y}{a}\right)} \cdot a + a \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{i \cdot \left(\frac{y}{a} \cdot a\right)} + a \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, \frac{y}{a} \cdot a, a\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\frac{y}{a} \cdot a}, a\right) \]
      8. lower-/.f6462.8

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\frac{y}{a}} \cdot a, a\right) \]
    14. Simplified62.8%

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

    if -6.1999999999999999e-61 < x < 2.1000000000000001e191

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\color{blue}{x \cdot \frac{\log y}{z}} + 1\right)\right)\right)\right)\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + a\right) \]
      9. rgt-mult-inverseN/A

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

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

        \[\leadsto z \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot \color{blue}{\left(\frac{1}{x} + \frac{\log y}{z}\right)}\right)\right)\right)\right) + \left(\log c \cdot \left(b - \frac{1}{2}\right) + a\right) \]
      12. remove-double-negN/A

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

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

      \[\leadsto \color{blue}{a + \left(z + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
    13. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right) \]
      5. sub-negN/A

        \[\leadsto a + \mathsf{fma}\left(\log c, \color{blue}{b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, z\right) \]
      6. metadata-evalN/A

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

        \[\leadsto a + \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right) \]
    14. Simplified58.1%

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

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

Alternative 13: 74.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z\right) + \mathsf{fma}\left(\log c, b + -0.5, a\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000016e118 or 5.5999999999999998e191 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6481.9

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

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

    if -2.90000000000000016e118 < x < 5.5999999999999998e191

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 72.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(i, y, x \cdot \log y\right)\\ \mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\ \;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + 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 i y (* x (log y)))))
   (if (<= x -2.9e+118)
     t_1
     (if (<= x 5.6e+191) (+ a (+ (fma i y z) (* 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(i, y, (x * log(y)));
	double tmp;
	if (x <= -2.9e+118) {
		tmp = t_1;
	} else if (x <= 5.6e+191) {
		tmp = a + (fma(i, y, z) + (b * log(c)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = fma(i, y, Float64(x * log(y)))
	tmp = 0.0
	if (x <= -2.9e+118)
		tmp = t_1;
	elseif (x <= 5.6e+191)
		tmp = Float64(a + Float64(fma(i, y, z) + 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[(i * y + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+118], t$95$1, If[LessEqual[x, 5.6e+191], N[(a + N[(N[(i * y + z), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.6 \cdot 10^{+191}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + b \cdot \log c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000016e118 or 5.5999999999999998e191 < 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified89.9%

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

      \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, y, \color{blue}{x \cdot \log y}\right) \]
      2. lower-log.f6481.9

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

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

    if -2.90000000000000016e118 < x < 5.5999999999999998e191

    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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a + \left(\mathsf{fma}\left(i, y, z\right) + \color{blue}{\log c \cdot b}\right) \]
      3. lower-log.f6478.6

        \[\leadsto a + \left(\mathsf{fma}\left(i, y, z\right) + \color{blue}{\log c} \cdot b\right) \]
    8. Simplified78.6%

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

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

Alternative 15: 57.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 1.6 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, \frac{y \cdot i}{a}, a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= a 1.6e+154)
   (fma y i (fma (log c) (+ b -0.5) z))
   (fma a (/ (* y i) a) a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 1.6e+154) {
		tmp = fma(y, i, fma(log(c), (b + -0.5), z));
	} else {
		tmp = fma(a, ((y * i) / a), a);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 1.6e+154)
		tmp = fma(y, i, fma(log(c), Float64(b + -0.5), z));
	else
		tmp = fma(a, Float64(Float64(y * i) / a), a);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.6e+154], N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(y * i), $MachinePrecision] / a), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.6 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y \cdot i}{a}, a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.6e154

    1. Initial program 99.8%

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

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

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right)\right) \]
      13. sub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right)\right) \]
    8. Simplified76.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, z + \log c \cdot \left(b - \frac{1}{2}\right)\right)} \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right) + z}\right) \]
      7. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y, i, \color{blue}{\mathsf{fma}\left(\log c, b - \frac{1}{2}, z\right)}\right) \]
      8. lower-log.f64N/A

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z\right)\right) \]
      9. sub-negN/A

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, \color{blue}{b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, z\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + \color{blue}{\frac{-1}{2}}, z\right)\right) \]
      11. lower-+.f6457.5

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, \color{blue}{b + -0.5}, z\right)\right) \]
    11. Simplified57.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)} \]

    if 1.6e154 < a

    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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

        \[\leadsto a + \color{blue}{\left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right)} \]
      3. associate-+l+N/A

        \[\leadsto a + \color{blue}{\left(i \cdot y + \left(\left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right) + z\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto a + \left(i \cdot y + \color{blue}{\left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)}\right) \]
      5. lower-fma.f64N/A

        \[\leadsto a + \color{blue}{\mathsf{fma}\left(i, y, z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
      6. associate-+r+N/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\left(z + x \cdot \log y\right) + \log c \cdot \left(b - \frac{1}{2}\right)}\right) \]
      7. +-commutativeN/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + x \cdot \log y\right)}\right) \]
      8. lower-fma.f64N/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(\log c, b - \frac{1}{2}, z + x \cdot \log y\right)}\right) \]
      9. lower-log.f64N/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z + x \cdot \log y\right)\right) \]
      10. sub-negN/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, \color{blue}{b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, z + x \cdot \log y\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + \color{blue}{\frac{-1}{2}}, z + x \cdot \log y\right)\right) \]
      12. lower-+.f64N/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, \color{blue}{b + \frac{-1}{2}}, z + x \cdot \log y\right)\right) \]
      13. +-commutativeN/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + \frac{-1}{2}, \color{blue}{x \cdot \log y + z}\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + \frac{-1}{2}, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right)\right) \]
      15. lower-log.f6488.0

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right)\right) \]
    5. Simplified88.0%

      \[\leadsto \color{blue}{a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \log y, z\right)\right)\right)} \]
    6. Taylor expanded in i around inf

      \[\leadsto a + \color{blue}{i \cdot y} \]
    7. Step-by-step derivation
      1. lower-*.f6475.5

        \[\leadsto a + \color{blue}{i \cdot y} \]
    8. Simplified75.5%

      \[\leadsto a + \color{blue}{i \cdot y} \]
    9. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(1 + \frac{i \cdot y}{a}\right)} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto a \cdot \color{blue}{\left(\frac{i \cdot y}{a} + 1\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto \color{blue}{a \cdot \frac{i \cdot y}{a} + a \cdot 1} \]
      3. *-rgt-identityN/A

        \[\leadsto a \cdot \frac{i \cdot y}{a} + \color{blue}{a} \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{i \cdot y}{a}, a\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{i \cdot y}{a}}, a\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{y \cdot i}}{a}, a\right) \]
      7. lower-*.f6475.5

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{y \cdot i}}{a}, a\right) \]
    11. Simplified75.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{y \cdot i}{a}, a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 38.7% accurate, 33.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, a\right) \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (fma y i a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(y, i, a);
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, a)
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + a), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, a\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. 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. lower-+.f64N/A

      \[\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)} \]
    2. +-commutativeN/A

      \[\leadsto a + \color{blue}{\left(\left(i \cdot y + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right) + z\right)} \]
    3. associate-+l+N/A

      \[\leadsto a + \color{blue}{\left(i \cdot y + \left(\left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right) + z\right)\right)} \]
    4. +-commutativeN/A

      \[\leadsto a + \left(i \cdot y + \color{blue}{\left(z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)}\right) \]
    5. lower-fma.f64N/A

      \[\leadsto a + \color{blue}{\mathsf{fma}\left(i, y, z + \left(x \cdot \log y + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)} \]
    6. associate-+r+N/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\left(z + x \cdot \log y\right) + \log c \cdot \left(b - \frac{1}{2}\right)}\right) \]
    7. +-commutativeN/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\log c \cdot \left(b - \frac{1}{2}\right) + \left(z + x \cdot \log y\right)}\right) \]
    8. lower-fma.f64N/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(\log c, b - \frac{1}{2}, z + x \cdot \log y\right)}\right) \]
    9. lower-log.f64N/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\color{blue}{\log c}, b - \frac{1}{2}, z + x \cdot \log y\right)\right) \]
    10. sub-negN/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, \color{blue}{b + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, z + x \cdot \log y\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + \color{blue}{\frac{-1}{2}}, z + x \cdot \log y\right)\right) \]
    12. lower-+.f64N/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, \color{blue}{b + \frac{-1}{2}}, z + x \cdot \log y\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + \frac{-1}{2}, \color{blue}{x \cdot \log y + z}\right)\right) \]
    14. lower-fma.f64N/A

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + \frac{-1}{2}, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right)\right) \]
    15. lower-log.f6485.3

      \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right)\right) \]
  5. Simplified85.3%

    \[\leadsto \color{blue}{a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \log y, z\right)\right)\right)} \]
  6. Taylor expanded in i around inf

    \[\leadsto a + \color{blue}{i \cdot y} \]
  7. Step-by-step derivation
    1. lower-*.f6440.9

      \[\leadsto a + \color{blue}{i \cdot y} \]
  8. Simplified40.9%

    \[\leadsto a + \color{blue}{i \cdot y} \]
  9. Taylor expanded in a around 0

    \[\leadsto \color{blue}{a + i \cdot y} \]
  10. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{i \cdot y + a} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{y \cdot i} + a \]
    3. lower-fma.f6440.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  11. Simplified40.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  12. Add Preprocessing

Alternative 17: 24.3% accurate, 39.0× speedup?

\[\begin{array}{l} \\ y \cdot i \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (* y i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 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 = 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 y * i;
}
def code(x, y, z, t, a, b, c, i):
	return y * i
function code(x, y, z, t, a, b, c, i)
	return Float64(y * i)
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = y * i;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i), $MachinePrecision]
\begin{array}{l}

\\
y \cdot i
\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-*.f6425.2

      \[\leadsto \color{blue}{i \cdot y} \]
  5. Simplified25.2%

    \[\leadsto \color{blue}{i \cdot y} \]
  6. Final simplification25.2%

    \[\leadsto y \cdot i \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024208 
(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)))