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

Percentage Accurate: 99.8% → 99.9%
Time: 22.4s
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.9% accurate, 0.5× speedup?

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

\\
\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) + \log c \cdot \left(b - 0.5\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. Step-by-step derivation
    1. associate-+l+99.9%

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

      \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    3. associate-+r+99.9%

      \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    4. +-commutative99.9%

      \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    5. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
    6. +-commutative99.9%

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
    11. associate-+l+99.9%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. +-commutative99.9%

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

      \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
    3. unsub-neg99.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
    7. associate-+l+99.9%

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
    14. distribute-lft-neg-in99.9%

      \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
    15. distribute-rgt-neg-in99.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
    19. distribute-neg-in99.9%

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

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

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

Alternative 2: 91.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+153} \lor \neg \left(x \leq 3 \cdot 10^{+243}\right):\\ \;\;\;\;\log y \cdot x + \left(t + \left(z + \left(y \cdot i + \log c \cdot -0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -5e+153) (not (<= x 3e+243)))
   (+ (* (log y) x) (+ t (+ z (+ (* y i) (* (log c) -0.5)))))
   (+ (* y i) (+ (+ a (+ z t)) (* (log c) (- b 0.5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -5e+153) || !(x <= 3e+243)) {
		tmp = (log(y) * x) + (t + (z + ((y * i) + (log(c) * -0.5))));
	} else {
		tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x <= (-5d+153)) .or. (.not. (x <= 3d+243))) then
        tmp = (log(y) * x) + (t + (z + ((y * i) + (log(c) * (-0.5d0)))))
    else
        tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x <= -5e+153) || !(x <= 3e+243)) {
		tmp = (Math.log(y) * x) + (t + (z + ((y * i) + (Math.log(c) * -0.5))));
	} else {
		tmp = (y * i) + ((a + (z + t)) + (Math.log(c) * (b - 0.5)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x <= -5e+153) or not (x <= 3e+243):
		tmp = (math.log(y) * x) + (t + (z + ((y * i) + (math.log(c) * -0.5))))
	else:
		tmp = (y * i) + ((a + (z + t)) + (math.log(c) * (b - 0.5)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((x <= -5e+153) || !(x <= 3e+243))
		tmp = Float64(Float64(log(y) * x) + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(log(c) * -0.5)))));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + t)) + Float64(log(c) * Float64(b - 0.5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x <= -5e+153) || ~((x <= 3e+243)))
		tmp = (log(y) * x) + (t + (z + ((y * i) + (log(c) * -0.5))));
	else
		tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -5e+153], N[Not[LessEqual[x, 3e+243]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+153} \lor \neg \left(x \leq 3 \cdot 10^{+243}\right):\\
\;\;\;\;\log y \cdot x + \left(t + \left(z + \left(y \cdot i + \log c \cdot -0.5\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.00000000000000018e153 or 2.99999999999999984e243 < 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. Step-by-step derivation
      1. associate-+l+99.7%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.7%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.7%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.7%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.7%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.8%

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

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

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

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

      \[\leadsto \color{blue}{\log y \cdot x + \left(t + \left(z + \left(-0.5 \cdot \log c + i \cdot y\right)\right)\right)} \]

    if -5.00000000000000018e153 < x < 2.99999999999999984e243

    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. Taylor expanded in x around 0 94.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+153} \lor \neg \left(x \leq 3 \cdot 10^{+243}\right):\\ \;\;\;\;\log y \cdot x + \left(t + \left(z + \left(y \cdot i + \log c \cdot -0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \]

Alternative 3: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;y \leq 5.5 \cdot 10^{-54}:\\ \;\;\;\;\left(a + \left(t_1 + \left(z + t\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(t + \left(z + t_1\right)\right)\right) + \log c \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (log y) x)))
   (if (<= y 5.5e-54)
     (+ (+ a (+ t_1 (+ z t))) (* (log c) (- b 0.5)))
     (+ (* y i) (+ (+ a (+ t (+ z t_1))) (* (log c) b))))))
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 (y <= 5.5e-54) {
		tmp = (a + (t_1 + (z + t))) + (log(c) * (b - 0.5));
	} else {
		tmp = (y * i) + ((a + (t + (z + t_1))) + (log(c) * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = log(y) * x
    if (y <= 5.5d-54) then
        tmp = (a + (t_1 + (z + t))) + (log(c) * (b - 0.5d0))
    else
        tmp = (y * i) + ((a + (t + (z + t_1))) + (log(c) * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = Math.log(y) * x;
	double tmp;
	if (y <= 5.5e-54) {
		tmp = (a + (t_1 + (z + t))) + (Math.log(c) * (b - 0.5));
	} else {
		tmp = (y * i) + ((a + (t + (z + t_1))) + (Math.log(c) * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = math.log(y) * x
	tmp = 0
	if y <= 5.5e-54:
		tmp = (a + (t_1 + (z + t))) + (math.log(c) * (b - 0.5))
	else:
		tmp = (y * i) + ((a + (t + (z + t_1))) + (math.log(c) * b))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(log(y) * x)
	tmp = 0.0
	if (y <= 5.5e-54)
		tmp = Float64(Float64(a + Float64(t_1 + Float64(z + t))) + Float64(log(c) * Float64(b - 0.5)));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + t_1))) + Float64(log(c) * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = log(y) * x;
	tmp = 0.0;
	if (y <= 5.5e-54)
		tmp = (a + (t_1 + (z + t))) + (log(c) * (b - 0.5));
	else
		tmp = (y * i) + ((a + (t + (z + t_1))) + (log(c) * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, 5.5e-54], N[(N[(a + N[(t$95$1 + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(t + \left(z + t_1\right)\right)\right) + \log c \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.50000000000000046e-54

    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. Step-by-step derivation
      1. associate-+l+99.9%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.9%

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

        \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
      3. unsub-neg99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
      19. distribute-neg-in99.9%

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

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

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

    if 5.50000000000000046e-54 < y

    1. Initial program 99.9%

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

      \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.5 \cdot 10^{-54}:\\ \;\;\;\;\left(a + \left(\log y \cdot x + \left(z + t\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right) + \log c \cdot b\right)\\ \end{array} \]

Alternative 4: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right) + \log c \cdot \left(b - 0.5\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. Final simplification99.9%

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

Alternative 5: 83.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.22 \cdot 10^{-135}:\\ \;\;\;\;\left(a + \left(\log y \cdot x + \left(z + t\right)\right)\right) - \log c \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y 1.22e-135)
   (- (+ a (+ (* (log y) x) (+ z t))) (* (log c) 0.5))
   (+ (* y i) (+ (+ a (+ z t)) (* (log c) (- b 0.5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 1.22e-135) {
		tmp = (a + ((log(y) * x) + (z + t))) - (log(c) * 0.5);
	} else {
		tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= 1.22d-135) then
        tmp = (a + ((log(y) * x) + (z + t))) - (log(c) * 0.5d0)
    else
        tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= 1.22e-135) {
		tmp = (a + ((Math.log(y) * x) + (z + t))) - (Math.log(c) * 0.5);
	} else {
		tmp = (y * i) + ((a + (z + t)) + (Math.log(c) * (b - 0.5)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= 1.22e-135:
		tmp = (a + ((math.log(y) * x) + (z + t))) - (math.log(c) * 0.5)
	else:
		tmp = (y * i) + ((a + (z + t)) + (math.log(c) * (b - 0.5)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= 1.22e-135)
		tmp = Float64(Float64(a + Float64(Float64(log(y) * x) + Float64(z + t))) - Float64(log(c) * 0.5));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + t)) + Float64(log(c) * Float64(b - 0.5))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= 1.22e-135)
		tmp = (a + ((log(y) * x) + (z + t))) - (log(c) * 0.5);
	else
		tmp = (y * i) + ((a + (z + t)) + (log(c) * (b - 0.5)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.22e-135], N[(N[(a + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[c], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.22 \cdot 10^{-135}:\\
\;\;\;\;\left(a + \left(\log y \cdot x + \left(z + t\right)\right)\right) - \log c \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.22e-135

    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. Step-by-step derivation
      1. associate-+l+99.9%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.9%

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

        \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
      3. unsub-neg99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
      19. distribute-neg-in99.9%

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

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

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

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

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

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

    if 1.22e-135 < y

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.22 \cdot 10^{-135}:\\ \;\;\;\;\left(a + \left(\log y \cdot x + \left(z + t\right)\right)\right) - \log c \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\right)\\ \end{array} \]

Alternative 6: 75.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \left(z + t\right)\\ \mathbf{if}\;i \leq -7.8 \cdot 10^{-15} \lor \neg \left(i \leq 8.8 \cdot 10^{-51}\right):\\ \;\;\;\;y \cdot i + \left(\log c \cdot -0.5 + t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \log c \cdot \left(b - 0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (+ z t))))
   (if (or (<= i -7.8e-15) (not (<= i 8.8e-51)))
     (+ (* y i) (+ (* (log c) -0.5) t_1))
     (+ t_1 (* (log c) (- b 0.5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (z + t);
	double tmp;
	if ((i <= -7.8e-15) || !(i <= 8.8e-51)) {
		tmp = (y * i) + ((log(c) * -0.5) + t_1);
	} else {
		tmp = t_1 + (log(c) * (b - 0.5));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a + (z + t)
    if ((i <= (-7.8d-15)) .or. (.not. (i <= 8.8d-51))) then
        tmp = (y * i) + ((log(c) * (-0.5d0)) + t_1)
    else
        tmp = t_1 + (log(c) * (b - 0.5d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (z + t);
	double tmp;
	if ((i <= -7.8e-15) || !(i <= 8.8e-51)) {
		tmp = (y * i) + ((Math.log(c) * -0.5) + t_1);
	} else {
		tmp = t_1 + (Math.log(c) * (b - 0.5));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (z + t)
	tmp = 0
	if (i <= -7.8e-15) or not (i <= 8.8e-51):
		tmp = (y * i) + ((math.log(c) * -0.5) + t_1)
	else:
		tmp = t_1 + (math.log(c) * (b - 0.5))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(z + t))
	tmp = 0.0
	if ((i <= -7.8e-15) || !(i <= 8.8e-51))
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * -0.5) + t_1));
	else
		tmp = Float64(t_1 + Float64(log(c) * Float64(b - 0.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (z + t);
	tmp = 0.0;
	if ((i <= -7.8e-15) || ~((i <= 8.8e-51)))
		tmp = (y * i) + ((log(c) * -0.5) + t_1);
	else
		tmp = t_1 + (log(c) * (b - 0.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[i, -7.8e-15], N[Not[LessEqual[i, 8.8e-51]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + \left(z + t\right)\\
\mathbf{if}\;i \leq -7.8 \cdot 10^{-15} \lor \neg \left(i \leq 8.8 \cdot 10^{-51}\right):\\
\;\;\;\;y \cdot i + \left(\log c \cdot -0.5 + t_1\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 + \log c \cdot \left(b - 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -7.80000000000000053e-15 or 8.8000000000000001e-51 < 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. Taylor expanded in x around 0 87.5%

      \[\leadsto \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)} + y \cdot i \]
    3. Taylor expanded in b around 0 80.4%

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

    if -7.80000000000000053e-15 < i < 8.8000000000000001e-51

    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. Step-by-step derivation
      1. associate-+l+99.9%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.9%

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

        \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
      3. unsub-neg99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
      19. distribute-neg-in99.9%

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

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

      \[\leadsto \color{blue}{\left(\log y \cdot x + \left(a + \left(t + z\right)\right)\right)} - \log c \cdot \left(0.5 + \left(-b\right)\right) \]
    8. Step-by-step derivation
      1. fma-def97.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -7.8 \cdot 10^{-15} \lor \neg \left(i \leq 8.8 \cdot 10^{-51}\right):\\ \;\;\;\;y \cdot i + \left(\log c \cdot -0.5 + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\\ \end{array} \]

Alternative 7: 42.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+100}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -11.5 \lor \neg \left(z \leq -7.5 \cdot 10^{-78}\right) \land z \leq -7.2 \cdot 10^{-171}:\\ \;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -2.4e+100)
   (+ z (* y i))
   (if (or (<= z -11.5) (and (not (<= z -7.5e-78)) (<= z -7.2e-171)))
     (+ a (* (log c) (- b 0.5)))
     (+ a (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -2.4e+100) {
		tmp = z + (y * i);
	} else if ((z <= -11.5) || (!(z <= -7.5e-78) && (z <= -7.2e-171))) {
		tmp = a + (log(c) * (b - 0.5));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (z <= (-2.4d+100)) then
        tmp = z + (y * i)
    else if ((z <= (-11.5d0)) .or. (.not. (z <= (-7.5d-78))) .and. (z <= (-7.2d-171))) then
        tmp = a + (log(c) * (b - 0.5d0))
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -2.4e+100) {
		tmp = z + (y * i);
	} else if ((z <= -11.5) || (!(z <= -7.5e-78) && (z <= -7.2e-171))) {
		tmp = a + (Math.log(c) * (b - 0.5));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -2.4e+100:
		tmp = z + (y * i)
	elif (z <= -11.5) or (not (z <= -7.5e-78) and (z <= -7.2e-171)):
		tmp = a + (math.log(c) * (b - 0.5))
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -2.4e+100)
		tmp = Float64(z + Float64(y * i));
	elseif ((z <= -11.5) || (!(z <= -7.5e-78) && (z <= -7.2e-171)))
		tmp = Float64(a + Float64(log(c) * Float64(b - 0.5)));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -2.4e+100)
		tmp = z + (y * i);
	elseif ((z <= -11.5) || (~((z <= -7.5e-78)) && (z <= -7.2e-171)))
		tmp = a + (log(c) * (b - 0.5));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.4e+100], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -11.5], And[N[Not[LessEqual[z, -7.5e-78]], $MachinePrecision], LessEqual[z, -7.2e-171]]], N[(a + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+100}:\\
\;\;\;\;z + y \cdot i\\

\mathbf{elif}\;z \leq -11.5 \lor \neg \left(z \leq -7.5 \cdot 10^{-78}\right) \land z \leq -7.2 \cdot 10^{-171}:\\
\;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.40000000000000012e100

    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. Taylor expanded in z around inf 64.6%

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

    if -2.40000000000000012e100 < z < -11.5 or -7.50000000000000041e-78 < z < -7.20000000000000006e-171

    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. Step-by-step derivation
      1. associate-+l+99.8%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.8%

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

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{a} - \log c \cdot \left(0.5 + \left(-b\right)\right) \]

    if -11.5 < z < -7.50000000000000041e-78 or -7.20000000000000006e-171 < z

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+100}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -11.5 \lor \neg \left(z \leq -7.5 \cdot 10^{-78}\right) \land z \leq -7.2 \cdot 10^{-171}:\\ \;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 8: 66.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -2.45 \cdot 10^{+72} \lor \neg \left(i \leq 1.4 \cdot 10^{+54}\right):\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -2.45e+72) (not (<= i 1.4e+54)))
   (+ a (* y i))
   (+ (+ a (+ z t)) (* (log c) (- b 0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -2.45e+72) || !(i <= 1.4e+54)) {
		tmp = a + (y * i);
	} else {
		tmp = (a + (z + t)) + (log(c) * (b - 0.5));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((i <= (-2.45d+72)) .or. (.not. (i <= 1.4d+54))) then
        tmp = a + (y * i)
    else
        tmp = (a + (z + t)) + (log(c) * (b - 0.5d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -2.45e+72) || !(i <= 1.4e+54)) {
		tmp = a + (y * i);
	} else {
		tmp = (a + (z + t)) + (Math.log(c) * (b - 0.5));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (i <= -2.45e+72) or not (i <= 1.4e+54):
		tmp = a + (y * i)
	else:
		tmp = (a + (z + t)) + (math.log(c) * (b - 0.5))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -2.45e+72) || !(i <= 1.4e+54))
		tmp = Float64(a + Float64(y * i));
	else
		tmp = Float64(Float64(a + Float64(z + t)) + Float64(log(c) * Float64(b - 0.5)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((i <= -2.45e+72) || ~((i <= 1.4e+54)))
		tmp = a + (y * i);
	else
		tmp = (a + (z + t)) + (log(c) * (b - 0.5));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.45e+72], N[Not[LessEqual[i, 1.4e+54]], $MachinePrecision]], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.45 \cdot 10^{+72} \lor \neg \left(i \leq 1.4 \cdot 10^{+54}\right):\\
\;\;\;\;a + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -2.45000000000000003e72 or 1.40000000000000008e54 < 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. Taylor expanded in a around inf 60.0%

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

    if -2.45000000000000003e72 < i < 1.40000000000000008e54

    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. Step-by-step derivation
      1. associate-+l+99.8%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.8%

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

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log y \cdot x + \left(a + \left(t + z\right)\right)\right)} - \log c \cdot \left(0.5 + \left(-b\right)\right) \]
    8. Step-by-step derivation
      1. fma-def93.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2.45 \cdot 10^{+72} \lor \neg \left(i \leq 1.4 \cdot 10^{+54}\right):\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\\ \end{array} \]

Alternative 9: 82.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + \left(z + t\right)\\ \mathbf{if}\;y \leq 4 \cdot 10^{-42}:\\ \;\;\;\;t_1 + \log c \cdot \left(b - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot b + t_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (+ z t))))
   (if (<= y 4e-42)
     (+ t_1 (* (log c) (- b 0.5)))
     (+ (* y i) (+ (* (log c) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (z + t);
	double tmp;
	if (y <= 4e-42) {
		tmp = t_1 + (log(c) * (b - 0.5));
	} else {
		tmp = (y * i) + ((log(c) * b) + t_1);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a + (z + t)
    if (y <= 4d-42) then
        tmp = t_1 + (log(c) * (b - 0.5d0))
    else
        tmp = (y * i) + ((log(c) * b) + t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (z + t);
	double tmp;
	if (y <= 4e-42) {
		tmp = t_1 + (Math.log(c) * (b - 0.5));
	} else {
		tmp = (y * i) + ((Math.log(c) * b) + t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (z + t)
	tmp = 0
	if y <= 4e-42:
		tmp = t_1 + (math.log(c) * (b - 0.5))
	else:
		tmp = (y * i) + ((math.log(c) * b) + t_1)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(z + t))
	tmp = 0.0
	if (y <= 4e-42)
		tmp = Float64(t_1 + Float64(log(c) * Float64(b - 0.5)));
	else
		tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * b) + t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (z + t);
	tmp = 0.0;
	if (y <= 4e-42)
		tmp = t_1 + (log(c) * (b - 0.5));
	else
		tmp = (y * i) + ((log(c) * b) + t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4e-42], N[(t$95$1 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot b + t_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.00000000000000015e-42

    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. Step-by-step derivation
      1. associate-+l+99.9%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.9%

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

        \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
      3. unsub-neg99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
      19. distribute-neg-in99.9%

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

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

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

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

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

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

    if 4.00000000000000015e-42 < y

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)} + y \cdot i \]
    3. Taylor expanded in b around inf 86.0%

      \[\leadsto \left(\color{blue}{\log c \cdot b} + \left(a + \left(t + z\right)\right)\right) + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4 \cdot 10^{-42}:\\ \;\;\;\;\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot b + \left(a + \left(z + t\right)\right)\right)\\ \end{array} \]

Alternative 10: 83.8% accurate, 1.9× speedup?

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

\\
y \cdot i + \left(\left(a + \left(z + t\right)\right) + \log c \cdot \left(b - 0.5\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. Taylor expanded in x around 0 84.9%

    \[\leadsto \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)} + y \cdot i \]
  3. Final simplification84.9%

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

Alternative 11: 41.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+100}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+15} \lor \neg \left(z \leq -7.2 \cdot 10^{-78}\right) \land z \leq -8 \cdot 10^{-171}:\\ \;\;\;\;a + \log c \cdot b\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -2.7e+100)
   (+ z (* y i))
   (if (or (<= z -1.8e+15) (and (not (<= z -7.2e-78)) (<= z -8e-171)))
     (+ a (* (log c) b))
     (+ a (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -2.7e+100) {
		tmp = z + (y * i);
	} else if ((z <= -1.8e+15) || (!(z <= -7.2e-78) && (z <= -8e-171))) {
		tmp = a + (log(c) * b);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (z <= (-2.7d+100)) then
        tmp = z + (y * i)
    else if ((z <= (-1.8d+15)) .or. (.not. (z <= (-7.2d-78))) .and. (z <= (-8d-171))) then
        tmp = a + (log(c) * b)
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -2.7e+100) {
		tmp = z + (y * i);
	} else if ((z <= -1.8e+15) || (!(z <= -7.2e-78) && (z <= -8e-171))) {
		tmp = a + (Math.log(c) * b);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -2.7e+100:
		tmp = z + (y * i)
	elif (z <= -1.8e+15) or (not (z <= -7.2e-78) and (z <= -8e-171)):
		tmp = a + (math.log(c) * b)
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -2.7e+100)
		tmp = Float64(z + Float64(y * i));
	elseif ((z <= -1.8e+15) || (!(z <= -7.2e-78) && (z <= -8e-171)))
		tmp = Float64(a + Float64(log(c) * b));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -2.7e+100)
		tmp = z + (y * i);
	elseif ((z <= -1.8e+15) || (~((z <= -7.2e-78)) && (z <= -8e-171)))
		tmp = a + (log(c) * b);
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.7e+100], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.8e+15], And[N[Not[LessEqual[z, -7.2e-78]], $MachinePrecision], LessEqual[z, -8e-171]]], N[(a + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+100}:\\
\;\;\;\;z + y \cdot i\\

\mathbf{elif}\;z \leq -1.8 \cdot 10^{+15} \lor \neg \left(z \leq -7.2 \cdot 10^{-78}\right) \land z \leq -8 \cdot 10^{-171}:\\
\;\;\;\;a + \log c \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.69999999999999998e100

    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. Taylor expanded in z around inf 64.6%

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

    if -2.69999999999999998e100 < z < -1.8e15 or -7.2000000000000005e-78 < z < -7.9999999999999999e-171

    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. Step-by-step derivation
      1. associate-+l+99.8%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.8%

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

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.8%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.8%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{a} - \log c \cdot \left(0.5 + \left(-b\right)\right) \]
    8. Taylor expanded in b around inf 37.7%

      \[\leadsto a - \color{blue}{-1 \cdot \left(\log c \cdot b\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg37.7%

        \[\leadsto a - \color{blue}{\left(-\log c \cdot b\right)} \]
      2. distribute-rgt-neg-out37.7%

        \[\leadsto a - \color{blue}{\log c \cdot \left(-b\right)} \]
    10. Simplified37.7%

      \[\leadsto a - \color{blue}{\log c \cdot \left(-b\right)} \]

    if -1.8e15 < z < -7.2000000000000005e-78 or -7.9999999999999999e-171 < z

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+100}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+15} \lor \neg \left(z \leq -7.2 \cdot 10^{-78}\right) \land z \leq -8 \cdot 10^{-171}:\\ \;\;\;\;a + \log c \cdot b\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 12: 68.9% accurate, 1.9× speedup?

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

\\
y \cdot i + \left(\left(z + a\right) + \log c \cdot \left(b - 0.5\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. Taylor expanded in x around 0 84.9%

    \[\leadsto \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)} + y \cdot i \]
  3. Step-by-step derivation
    1. add-sqr-sqrt39.9%

      \[\leadsto \left(\color{blue}{\sqrt{\left(b - 0.5\right) \cdot \log c} \cdot \sqrt{\left(b - 0.5\right) \cdot \log c}} + \left(a + \left(t + z\right)\right)\right) + y \cdot i \]
    2. pow239.9%

      \[\leadsto \left(\color{blue}{{\left(\sqrt{\left(b - 0.5\right) \cdot \log c}\right)}^{2}} + \left(a + \left(t + z\right)\right)\right) + y \cdot i \]
    3. sub-neg39.9%

      \[\leadsto \left({\left(\sqrt{\color{blue}{\left(b + \left(-0.5\right)\right)} \cdot \log c}\right)}^{2} + \left(a + \left(t + z\right)\right)\right) + y \cdot i \]
    4. metadata-eval39.9%

      \[\leadsto \left({\left(\sqrt{\left(b + \color{blue}{-0.5}\right) \cdot \log c}\right)}^{2} + \left(a + \left(t + z\right)\right)\right) + y \cdot i \]
  4. Applied egg-rr39.9%

    \[\leadsto \left(\color{blue}{{\left(\sqrt{\left(b + -0.5\right) \cdot \log c}\right)}^{2}} + \left(a + \left(t + z\right)\right)\right) + y \cdot i \]
  5. Taylor expanded in t around 0 70.1%

    \[\leadsto \color{blue}{\left(\left(b - 0.5\right) \cdot \log c + \left(a + z\right)\right)} + y \cdot i \]
  6. Final simplification70.1%

    \[\leadsto y \cdot i + \left(\left(z + a\right) + \log c \cdot \left(b - 0.5\right)\right) \]

Alternative 13: 42.9% accurate, 31.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+136}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -5.6e+136) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -5.6e+136) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (z <= (-5.6d+136)) then
        tmp = z + (y * i)
    else
        tmp = a + (y * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -5.6e+136) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -5.6e+136:
		tmp = z + (y * i)
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -5.6e+136)
		tmp = Float64(z + Float64(y * i));
	else
		tmp = Float64(a + Float64(y * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -5.6e+136)
		tmp = z + (y * i);
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.6e+136], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+136}:\\
\;\;\;\;z + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.6000000000000004e136

    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. Taylor expanded in z around inf 66.6%

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

    if -5.6000000000000004e136 < z

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+136}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 14: 27.2% accurate, 43.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.3 \cdot 10^{+146}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 2.3e+146) (* y i) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 2.3e+146) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (a <= 2.3d+146) then
        tmp = y * i
    else
        tmp = a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (a <= 2.3e+146) {
		tmp = y * i;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 2.3e+146:
		tmp = y * i
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (a <= 2.3e+146)
		tmp = Float64(y * i);
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (a <= 2.3e+146)
		tmp = y * i;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 2.3e+146], N[(y * i), $MachinePrecision], a]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.3 \cdot 10^{+146}:\\
\;\;\;\;y \cdot i\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.3e146

    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. Step-by-step derivation
      1. associate-+l+99.9%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative99.9%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+99.9%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative99.9%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.9%

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

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

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

      \[\leadsto \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative26.2%

        \[\leadsto \color{blue}{y \cdot i} \]
    6. Simplified26.2%

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

    if 2.3e146 < a

    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. Step-by-step derivation
      1. associate-+l+100.0%

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

        \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      3. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      4. +-commutative100.0%

        \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
      5. associate-+l+100.0%

        \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
      6. +-commutative100.0%

        \[\leadsto \color{blue}{y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
      7. fma-def100.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
      11. associate-+l+99.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
      3. unsub-neg100.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
      7. associate-+l+99.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
      14. distribute-lft-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
      15. distribute-rgt-neg-in99.9%

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

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

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

        \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
      19. distribute-neg-in99.9%

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

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

      \[\leadsto \color{blue}{a} - \log c \cdot \left(0.5 + \left(-b\right)\right) \]
    8. Taylor expanded in a around inf 44.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.3 \cdot 10^{+146}:\\ \;\;\;\;y \cdot i\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 15: 37.5% accurate, 43.8× speedup?

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

\\
a + 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. Taylor expanded in a around inf 40.0%

    \[\leadsto \color{blue}{a} + y \cdot i \]
  3. Final simplification40.0%

    \[\leadsto a + y \cdot i \]

Alternative 16: 15.8% accurate, 219.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. Step-by-step derivation
    1. associate-+l+99.9%

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

      \[\leadsto \color{blue}{\left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    3. associate-+r+99.9%

      \[\leadsto \color{blue}{\left(\left(a + \left(x \cdot \log y + z\right)\right) + t\right)} + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    4. +-commutative99.9%

      \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + z\right) + a\right)} + t\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    5. associate-+l+99.9%

      \[\leadsto \color{blue}{\left(\left(\left(\left(x \cdot \log y + z\right) + a\right) + t\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i} \]
    6. +-commutative99.9%

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \color{blue}{t + \left(\left(x \cdot \log y + z\right) + a\right)}\right)\right) \]
    11. associate-+l+99.9%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. +-commutative99.9%

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

      \[\leadsto \left(\log y \cdot x + \left(a + \left(t + \left(z + i \cdot y\right)\right)\right)\right) + \color{blue}{\left(-\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right)} \]
    3. unsub-neg99.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\left(z + i \cdot y\right) + t\right)} + a\right) - \left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right) \]
    7. associate-+l+99.9%

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c\right)} \cdot \left(b - 0.5\right) \]
    14. distribute-lft-neg-in99.9%

      \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \color{blue}{\left(-\log c \cdot \left(b - 0.5\right)\right)} \]
    15. distribute-rgt-neg-in99.9%

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

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

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

      \[\leadsto \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, z\right) + \left(a + t\right)\right) - \log c \cdot \left(-\color{blue}{\left(-0.5 + b\right)}\right) \]
    19. distribute-neg-in99.9%

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

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

    \[\leadsto \color{blue}{a} - \log c \cdot \left(0.5 + \left(-b\right)\right) \]
  8. Taylor expanded in a around inf 16.9%

    \[\leadsto \color{blue}{a} \]
  9. Final simplification16.9%

    \[\leadsto a \]

Reproduce

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