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

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

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

\\
\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)
\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. Final simplification99.9%

    \[\leadsto \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) \]

Alternative 2: 91.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+52} \lor \neg \left(x \leq 1.9 \cdot 10^{+125}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(z + \left(x \cdot \log y + \log c \cdot -0.5\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4e52 or 1.90000000000000001e125 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

    if -1.4e52 < x < 1.90000000000000001e125

    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 98.6%

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

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

Alternative 3: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \left(b - 0.5\right) \cdot \log c\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 + x \cdot \log y\right)\right)\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]

Alternative 4: 98.1% accurate, 1.0× speedup?

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

\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\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 b around inf 98.9%

    \[\leadsto \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
  3. Step-by-step derivation
    1. *-commutative48.6%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
  4. Simplified98.9%

    \[\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 \]
  5. Final simplification98.9%

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

Alternative 5: 91.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+213} \lor \neg \left(x \leq 5 \cdot 10^{+153}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4999999999999999e213 or 5.00000000000000018e153 < 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. Taylor expanded in x around inf 85.8%

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

      \[\leadsto \left(x \cdot \log y + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative26.1%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified85.8%

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

    if -2.4999999999999999e213 < x < 5.00000000000000018e153

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

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

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

Alternative 6: 87.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{+236} \lor \neg \left(x \leq 1.2 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot \log y + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.60000000000000051e236 or 1.1999999999999999e163 < 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. Taylor expanded in x around inf 85.0%

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

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

    if -9.60000000000000051e236 < x < 1.1999999999999999e163

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

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

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

Alternative 7: 86.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+237} \lor \neg \left(x \leq 1.2 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.99999999999999976e237 or 1.1999999999999999e163 < 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. Taylor expanded in x around inf 85.0%

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

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

    if -3.99999999999999976e237 < x < 1.1999999999999999e163

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

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

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

Alternative 8: 61.2% accurate, 1.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(a + \left(t + \left(z + -0.5 \cdot \log c\right)\right)\right)} + y \cdot i \]
    6. Step-by-step derivation
      1. +-commutative76.6%

        \[\leadsto \left(a + \left(t + \color{blue}{\left(-0.5 \cdot \log c + z\right)}\right)\right) + y \cdot i \]
      2. *-commutative76.6%

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

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

    if -5.0000000000000004e68 < 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 52.4%

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

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

Alternative 9: 59.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+96}:\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\

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


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

    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 74.2%

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

      \[\leadsto \left(z + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative32.9%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified74.2%

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

    if -3e96 < 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 52.1%

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

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

Alternative 10: 42.1% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;z \leq -6.2 \cdot 10^{-192}:\\
\;\;\;\;a + \left(b - 0.5\right) \cdot \log c\\

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


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

    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. Taylor expanded in t around 0 85.1%

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

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

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

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

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

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

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

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

    if -8.9999999999999997e66 < z < -6.2000000000000001e-192

    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 65.9%

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

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

    if -6.2000000000000001e-192 < 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 48.4%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative47.7%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified47.7%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 36.9%

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

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

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

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

Alternative 11: 56.6% accurate, 2.0× speedup?

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

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

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


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

    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 t around 0 90.3%

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

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

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

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

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

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

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

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

    if -5.39999999999999992e191 < 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 51.1%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative50.0%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified50.0%

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

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

Alternative 12: 57.8% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+96}:\\
\;\;\;\;y \cdot i + \left(z + t_1\right)\\

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


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

    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 74.2%

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

      \[\leadsto \left(z + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative32.9%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified74.2%

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

    if -4.09999999999999998e96 < 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 52.1%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative51.0%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified51.0%

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

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

Alternative 13: 42.6% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;z \leq -7.4 \cdot 10^{-47} \lor \neg \left(z \leq -8.5 \cdot 10^{-93}\right):\\
\;\;\;\;a + y \cdot i\\

\mathbf{else}:\\
\;\;\;\;x \cdot \log y\\


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

    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 t around 0 86.0%

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

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

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

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

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

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

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

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

    if -5.80000000000000027e95 < z < -7.4000000000000001e-47 or -8.5000000000000007e-93 < 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 52.9%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative52.1%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified52.1%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 38.6%

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

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

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

    if -7.4000000000000001e-47 < z < -8.5000000000000007e-93

    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. Taylor expanded in x around inf 100.0%

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+95}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{-47} \lor \neg \left(z \leq -8.5 \cdot 10^{-93}\right):\\ \;\;\;\;a + y \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]

Alternative 14: 41.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+66}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-192}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -5.5e+66)
   (+ z (* y i))
   (if (<= z -5.5e-192) (+ a (* b (log c))) (+ 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.5e+66) {
		tmp = z + (y * i);
	} else if (z <= -5.5e-192) {
		tmp = a + (b * log(c));
	} 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.5d+66)) then
        tmp = z + (y * i)
    else if (z <= (-5.5d-192)) then
        tmp = a + (b * log(c))
    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.5e+66) {
		tmp = z + (y * i);
	} else if (z <= -5.5e-192) {
		tmp = a + (b * Math.log(c));
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -5.5e+66:
		tmp = z + (y * i)
	elif z <= -5.5e-192:
		tmp = a + (b * math.log(c))
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -5.5e+66)
		tmp = Float64(z + Float64(y * i));
	elseif (z <= -5.5e-192)
		tmp = Float64(a + Float64(b * log(c)));
	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.5e+66)
		tmp = z + (y * i);
	elseif (z <= -5.5e-192)
		tmp = a + (b * log(c));
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.5e+66], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e-192], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{-192}:\\
\;\;\;\;a + b \cdot \log c\\

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


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

    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. Taylor expanded in t around 0 85.1%

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

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

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

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

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

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

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

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

    if -5.5e66 < z < -5.49999999999999995e-192

    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 65.9%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative62.8%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified62.8%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Taylor expanded in y around 0 45.1%

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

    if -5.49999999999999995e-192 < 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 48.4%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative47.7%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified47.7%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 36.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+66}:\\ \;\;\;\;z + y \cdot i\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{-192}:\\ \;\;\;\;a + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \]

Alternative 15: 40.9% accurate, 31.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+232}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= z -3.2e+232) z (+ 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 <= -3.2e+232) {
		tmp = z;
	} 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 <= (-3.2d+232)) then
        tmp = z
    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 <= -3.2e+232) {
		tmp = z;
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -3.2e+232:
		tmp = z
	else:
		tmp = a + (y * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -3.2e+232)
		tmp = z;
	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 <= -3.2e+232)
		tmp = z;
	else
		tmp = a + (y * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3.2e+232], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+232}:\\
\;\;\;\;z\\

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


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

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

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

      \[\leadsto \color{blue}{z} \]

    if -3.2000000000000002e232 < 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 51.3%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative50.3%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified50.3%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 36.8%

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

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

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

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

Alternative 16: 43.4% accurate, 31.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+97}:\\ \;\;\;\;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 -1.3e+97) (+ 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 <= -1.3e+97) {
		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 <= (-1.3d+97)) 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 <= -1.3e+97) {
		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 <= -1.3e+97:
		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 <= -1.3e+97)
		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 <= -1.3e+97)
		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, -1.3e+97], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    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 t around 0 86.0%

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

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

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

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

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

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

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

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

    if -1.3e97 < 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 52.1%

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

      \[\leadsto \left(a + \color{blue}{b \cdot \log c}\right) + y \cdot i \]
    4. Step-by-step derivation
      1. *-commutative51.0%

        \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    5. Simplified51.0%

      \[\leadsto \left(a + \color{blue}{\log c \cdot b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 37.6%

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

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

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

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

Alternative 17: 20.7% accurate, 71.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{+97}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.32e+97) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (z <= -1.32e+97) {
		tmp = z;
	} 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 (z <= (-1.32d+97)) then
        tmp = z
    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 (z <= -1.32e+97) {
		tmp = z;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if z <= -1.32e+97:
		tmp = z
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (z <= -1.32e+97)
		tmp = z;
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (z <= -1.32e+97)
		tmp = z;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.32e+97], z, a]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+97}:\\
\;\;\;\;z\\

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


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

    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 74.2%

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

      \[\leadsto \color{blue}{z} \]

    if -1.31999999999999994e97 < 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 52.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{+97}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 18: 16.1% 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. Taylor expanded in a around inf 49.6%

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

    \[\leadsto \color{blue}{a} \]
  4. Final simplification15.0%

    \[\leadsto a \]

Reproduce

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