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

Percentage Accurate: 99.8% → 99.8%
Time: 15.3s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 20.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;a\\

\mathbf{else}:\\
\;\;\;\;y \cdot i\\


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

    1. Initial program 99.9%

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

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

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

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

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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    7. Step-by-step derivation
      1. lower-/.f645.5

        \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    8. Applied rewrites5.5%

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{a}{i} \cdot i} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{a}{i}} \cdot i \]
      4. div-invN/A

        \[\leadsto \color{blue}{\left(a \cdot \frac{1}{i}\right)} \cdot i \]
      5. lift-/.f64N/A

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

        \[\leadsto \color{blue}{a \cdot \left(\frac{1}{i} \cdot i\right)} \]
      7. lift-/.f64N/A

        \[\leadsto a \cdot \left(\color{blue}{\frac{1}{i}} \cdot i\right) \]
      8. inv-powN/A

        \[\leadsto a \cdot \left(\color{blue}{{i}^{-1}} \cdot i\right) \]
      9. pow-plusN/A

        \[\leadsto a \cdot \color{blue}{{i}^{\left(-1 + 1\right)}} \]
      10. metadata-evalN/A

        \[\leadsto a \cdot {i}^{\color{blue}{0}} \]
      11. metadata-evalN/A

        \[\leadsto a \cdot \color{blue}{1} \]
      12. lower-*.f6413.7

        \[\leadsto \color{blue}{a \cdot 1} \]
    10. Applied rewrites13.7%

      \[\leadsto \color{blue}{a \cdot 1} \]
    11. Step-by-step derivation
      1. *-rgt-identity13.7

        \[\leadsto \color{blue}{a} \]
    12. Applied rewrites13.7%

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification17.2%

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

Alternative 3: 75.4% accurate, 0.7× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.99999999999999983e156

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

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

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

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
      3. lower-log.f6474.4

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

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Taylor expanded in c around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + b \cdot \log c \]
      3. lower-fma.f64N/A

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

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

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

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

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

    if -9.99999999999999983e156 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 5.00000000000000034e173

    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. Applied rewrites73.6%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6457.8

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

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6476.0

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites76.0%

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

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

    1. Initial program 99.6%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)} + y \cdot i \]
    5. 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)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\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) + a\right) \]
      14. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.6% accurate, 0.7× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t + \left(a + t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.99999999999999983e156

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

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

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

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
      3. lower-log.f6474.4

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

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Taylor expanded in c around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + b \cdot \log c \]
      3. lower-fma.f64N/A

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

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

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

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

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

    if -9.99999999999999983e156 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 5.00000000000000034e173

    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. Applied rewrites73.6%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6457.8

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

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6476.0

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites76.0%

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

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

    1. Initial program 99.6%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)} + y \cdot i \]
    5. 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)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\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) + a\right) \]
      14. metadata-evalN/A

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

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

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

      \[\leadsto t + \left(\color{blue}{b \cdot \log c} + a\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto t + \left(\color{blue}{\log c \cdot b} + a\right) \]
      3. lower-log.f6475.6

        \[\leadsto t + \left(\color{blue}{\log c} \cdot b + a\right) \]
    10. Applied rewrites75.6%

      \[\leadsto t + \left(\color{blue}{\log c \cdot b} + a\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.7%

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

Alternative 5: 58.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+201}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+227}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.00000000000000004e201 or 4.9999999999999996e227 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\log c \cdot b} \]
      3. lower-log.f6478.6

        \[\leadsto \color{blue}{\log c} \cdot b \]
    5. Applied rewrites78.6%

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

    if -1.00000000000000004e201 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999996e227

    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. Applied rewrites72.2%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6454.9

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites54.9%

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

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

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

        \[\leadsto a + \color{blue}{\left(i \cdot y + z\right)} \]
      3. lower-fma.f6456.9

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

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

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

Alternative 6: 93.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 7.6 \cdot 10^{+138}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(y, i, t\_1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{x}, x, \mathsf{fma}\left(x, \log y + \frac{a}{x}, y \cdot i\right)\right)\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999963e99 < x < 7.60000000000000025e138

    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. Step-by-step derivation
      1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)} + y \cdot i \]
    5. 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)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\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) + a\right) \]
      14. metadata-evalN/A

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

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

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

    if 7.60000000000000025e138 < x

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{x \cdot \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. Applied rewrites99.7%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6483.7

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites83.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{x}, x, \color{blue}{x \cdot \left(\log y + \frac{a}{x}\right)} + y \cdot i\right) \]
      12. lower-fma.f6483.7

        \[\leadsto \mathsf{fma}\left(\frac{z}{x}, x, \color{blue}{\mathsf{fma}\left(x, \log y + \frac{a}{x}, y \cdot i\right)}\right) \]
    10. Applied rewrites83.7%

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

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

Alternative 7: 84.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.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.f6483.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. Applied rewrites83.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. Add Preprocessing

Alternative 8: 92.6% accurate, 1.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{x}, x, \mathsf{fma}\left(x, \log y + \frac{a}{x}, y \cdot i\right)\right)\\


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

    1. Initial program 99.8%

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

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

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6475.9

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites75.9%

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6475.9

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites75.9%

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

    if -1.2e112 < x < 7.60000000000000025e138

    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. Step-by-step derivation
      1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)} + y \cdot i \]
    5. 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)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\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) + a\right) \]
      14. metadata-evalN/A

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

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

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

    if 7.60000000000000025e138 < x

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{x \cdot \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. Applied rewrites99.7%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6483.7

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites83.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{x}, x, \color{blue}{x \cdot \left(\log y + \frac{a}{x}\right)} + y \cdot i\right) \]
      12. lower-fma.f6483.7

        \[\leadsto \mathsf{fma}\left(\frac{z}{x}, x, \color{blue}{\mathsf{fma}\left(x, \log y + \frac{a}{x}, y \cdot i\right)}\right) \]
    10. Applied rewrites83.7%

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

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

Alternative 9: 92.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+108}:\\ \;\;\;\;t + \left(a + \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (fma i y (fma x (log y) z)))))
   (if (<= x -1.2e+112)
     t_1
     (if (<= x 3.4e+108)
       (+ t (+ a (fma y i (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 = a + fma(i, y, fma(x, log(y), z));
	double tmp;
	if (x <= -1.2e+112) {
		tmp = t_1;
	} else if (x <= 3.4e+108) {
		tmp = t + (a + fma(y, i, 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 = Float64(a + fma(i, y, fma(x, log(y), z)))
	tmp = 0.0
	if (x <= -1.2e+112)
		tmp = t_1;
	elseif (x <= 3.4e+108)
		tmp = Float64(t + Float64(a + fma(y, i, 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[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+112], t$95$1, If[LessEqual[x, 3.4e+108], N[(t + N[(a + N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.2e112 or 3.39999999999999996e108 < x

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in 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. Applied rewrites99.7%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6479.4

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

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6479.5

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites79.5%

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

    if -1.2e112 < x < 3.39999999999999996e108

    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. Step-by-step derivation
      1. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)} + y \cdot i \]
    5. 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)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\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) + a\right) \]
      14. metadata-evalN/A

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

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

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

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

Alternative 10: 92.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+108}:\\ \;\;\;\;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 (+ a (fma i y (fma x (log y) z)))))
   (if (<= x -1.2e+112)
     t_1
     (if (<= x 3.4e+108)
       (+ 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 = a + fma(i, y, fma(x, log(y), z));
	double tmp;
	if (x <= -1.2e+112) {
		tmp = t_1;
	} else if (x <= 3.4e+108) {
		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 = Float64(a + fma(i, y, fma(x, log(y), z)))
	tmp = 0.0
	if (x <= -1.2e+112)
		tmp = t_1;
	elseif (x <= 3.4e+108)
		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[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+112], t$95$1, If[LessEqual[x, 3.4e+108], 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 := a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 3.4 \cdot 10^{+108}:\\
\;\;\;\;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 < -1.2e112 or 3.39999999999999996e108 < x

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in 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. Applied rewrites99.7%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6479.4

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

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6479.5

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites79.5%

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

    if -1.2e112 < x < 3.39999999999999996e108

    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.4

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

      \[\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 11: 59.8% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;b \leq 7.6 \cdot 10^{-45}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\

\mathbf{elif}\;b \leq 4.4 \cdot 10^{+170}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, z + a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.9e151 or 4.39999999999999978e170 < b

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

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

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

        \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
      3. lower-log.f6475.0

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

      \[\leadsto \color{blue}{\log c \cdot b} + y \cdot i \]
    6. Taylor expanded in c around 0

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

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

        \[\leadsto \color{blue}{y \cdot i} + b \cdot \log c \]
      3. lower-fma.f64N/A

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

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

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

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

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

    if -1.9e151 < b < 7.59999999999999994e-45

    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. Applied rewrites73.3%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6456.9

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites56.9%

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

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

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

        \[\leadsto a + \color{blue}{\left(i \cdot y + z\right)} \]
      3. lower-fma.f6462.7

        \[\leadsto a + \color{blue}{\mathsf{fma}\left(i, y, z\right)} \]
    11. Applied rewrites62.7%

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

    if 7.59999999999999994e-45 < b < 4.39999999999999978e170

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x \cdot \left(\log y + \left(\frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - \frac{1}{2}\right)}{x}\right)\right)\right)\right)} + y \cdot i \]
    4. Step-by-step derivation
      1. 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. Applied rewrites74.9%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6457.8

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

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6470.9

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites70.9%

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

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

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

        \[\leadsto \color{blue}{x \cdot \log y + \left(a + z\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, a + z\right)} \]
      4. lower-log.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log y}, a + z\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{z + a}\right) \]
      6. lower-+.f6453.8

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{z + a}\right) \]
    14. Applied rewrites53.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, z + a\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.9 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{-45}:\\ \;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\ \mathbf{elif}\;b \leq 4.4 \cdot 10^{+170}:\\ \;\;\;\;\mathsf{fma}\left(x, \log y, z + a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.4% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 7 \cdot 10^{+90}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.49999999999999963e99 or 6.9999999999999997e90 < x

    1. Initial program 99.8%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in 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. Applied rewrites99.7%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6475.2

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites75.2%

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

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

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

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

        \[\leadsto a + \left(\color{blue}{\left(i \cdot y + z\right)} + x \cdot \log y\right) \]
      4. associate-+l+N/A

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

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

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

        \[\leadsto a + \mathsf{fma}\left(i, y, \color{blue}{\mathsf{fma}\left(x, \log y, z\right)}\right) \]
      8. lower-log.f6475.3

        \[\leadsto a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \color{blue}{\log y}, z\right)\right) \]
    11. Applied rewrites75.3%

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

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

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

        \[\leadsto \color{blue}{x \cdot \log y + \left(a + z\right)} \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, a + z\right)} \]
      4. lower-log.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log y}, a + z\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{z + a}\right) \]
      6. lower-+.f6465.2

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{z + a}\right) \]
    14. Applied rewrites65.2%

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

    if -7.49999999999999963e99 < x < 6.9999999999999997e90

    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. Applied rewrites57.1%

      \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6438.9

        \[\leadsto x \cdot \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    8. Applied rewrites38.9%

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

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

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

        \[\leadsto a + \color{blue}{\left(i \cdot y + z\right)} \]
      3. lower-fma.f6459.8

        \[\leadsto a + \color{blue}{\mathsf{fma}\left(i, y, z\right)} \]
    11. Applied rewrites59.8%

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

Alternative 13: 58.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+214}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.79999999999999969e171 or 1.10000000000000012e214 < x

    1. Initial program 99.8%

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

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

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

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

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

    if -5.79999999999999969e171 < x < 1.10000000000000012e214

    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. Applied rewrites63.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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
    7. Step-by-step derivation
      1. lower-/.f6441.4

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

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

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

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

        \[\leadsto a + \color{blue}{\left(i \cdot y + z\right)} \]
      3. lower-fma.f6457.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+171}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+214}:\\ \;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 53.3% accurate, 23.4× speedup?

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

\\
a + \mathsf{fma}\left(i, y, z\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Add Preprocessing
  3. Taylor expanded in x around 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. Applied rewrites69.4%

    \[\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 \left(\color{blue}{\frac{z}{x}} + \left(\log y + \frac{a}{x}\right)\right) + y \cdot i \]
  7. Step-by-step derivation
    1. lower-/.f6449.4

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

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

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

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

      \[\leadsto a + \color{blue}{\left(i \cdot y + z\right)} \]
    3. lower-fma.f6450.7

      \[\leadsto a + \color{blue}{\mathsf{fma}\left(i, y, z\right)} \]
  11. Applied rewrites50.7%

    \[\leadsto \color{blue}{a + \mathsf{fma}\left(i, y, z\right)} \]
  12. Add Preprocessing

Alternative 15: 39.0% 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.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. Applied rewrites69.4%

    \[\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 a around inf

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

      \[\leadsto x \cdot \color{blue}{\frac{a}{x}} + y \cdot i \]
  8. Applied rewrites28.6%

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

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

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

      \[\leadsto \color{blue}{\frac{a}{x} \cdot x} + y \cdot i \]
    4. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{a}{x}} \cdot x + y \cdot i \]
    5. div-invN/A

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

      \[\leadsto \color{blue}{a \cdot \left(\frac{1}{x} \cdot x\right)} + y \cdot i \]
    7. inv-powN/A

      \[\leadsto a \cdot \left(\color{blue}{{x}^{-1}} \cdot x\right) + y \cdot i \]
    8. pow-plusN/A

      \[\leadsto a \cdot \color{blue}{{x}^{\left(-1 + 1\right)}} + y \cdot i \]
    9. metadata-evalN/A

      \[\leadsto a \cdot {x}^{\color{blue}{0}} + y \cdot i \]
    10. metadata-evalN/A

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

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

      \[\leadsto \color{blue}{y \cdot i + a} \]
    13. lift-*.f64N/A

      \[\leadsto \color{blue}{y \cdot i} + a \]
    14. lower-fma.f6434.8

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, a\right)} \]
  10. Applied rewrites34.8%

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

Alternative 16: 16.7% accurate, 234.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a;
}
def code(x, y, z, t, a, b, c, i):
	return a
function code(x, y, z, t, a, b, c, i)
	return a
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}

\\
a
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
  7. Step-by-step derivation
    1. lower-/.f647.2

      \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
  8. Applied rewrites7.2%

    \[\leadsto i \cdot \color{blue}{\frac{a}{i}} \]
  9. Step-by-step derivation
    1. lift-/.f64N/A

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

      \[\leadsto \color{blue}{\frac{a}{i} \cdot i} \]
    3. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{a}{i}} \cdot i \]
    4. div-invN/A

      \[\leadsto \color{blue}{\left(a \cdot \frac{1}{i}\right)} \cdot i \]
    5. lift-/.f64N/A

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

      \[\leadsto \color{blue}{a \cdot \left(\frac{1}{i} \cdot i\right)} \]
    7. lift-/.f64N/A

      \[\leadsto a \cdot \left(\color{blue}{\frac{1}{i}} \cdot i\right) \]
    8. inv-powN/A

      \[\leadsto a \cdot \left(\color{blue}{{i}^{-1}} \cdot i\right) \]
    9. pow-plusN/A

      \[\leadsto a \cdot \color{blue}{{i}^{\left(-1 + 1\right)}} \]
    10. metadata-evalN/A

      \[\leadsto a \cdot {i}^{\color{blue}{0}} \]
    11. metadata-evalN/A

      \[\leadsto a \cdot \color{blue}{1} \]
    12. lower-*.f6414.3

      \[\leadsto \color{blue}{a \cdot 1} \]
  10. Applied rewrites14.3%

    \[\leadsto \color{blue}{a \cdot 1} \]
  11. Step-by-step derivation
    1. *-rgt-identity14.3

      \[\leadsto \color{blue}{a} \]
  12. Applied rewrites14.3%

    \[\leadsto \color{blue}{a} \]
  13. Add Preprocessing

Reproduce

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