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

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Add Preprocessing
  3. Final simplification99.5%

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

Alternative 2: 93.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.5%

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

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

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

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

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

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

    if -1.3200000000000001e98 < x < 3.99999999999999974e169

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if 3.99999999999999974e169 < x

    1. Initial program 99.8%

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

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

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

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

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

Alternative 3: 92.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.5%

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

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

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

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

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

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

    if -4.09999999999999979e99 < x < 3.99999999999999974e169

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

    if 3.99999999999999974e169 < x

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 4: 92.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+100} \lor \neg \left(x \leq 4 \cdot 10^{+169}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.0499999999999999e100 or 3.99999999999999974e169 < x

    1. Initial program 98.5%

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

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

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

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

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

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

    if -1.0499999999999999e100 < x < 3.99999999999999974e169

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

Alternative 5: 92.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+99} \lor \neg \left(x \leq 1.65 \cdot 10^{+174}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8000000000000001e99 or 1.65e174 < x

    1. Initial program 98.5%

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

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

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

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

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

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

    if -1.8000000000000001e99 < x < 1.65e174

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

Alternative 6: 92.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+99} \lor \neg \left(x \leq 4 \cdot 10^{+169}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.49999999999999984e99 or 3.99999999999999974e169 < x

    1. Initial program 98.5%

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

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

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

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

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

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

    if -8.49999999999999984e99 < x < 3.99999999999999974e169

    1. Initial program 99.8%

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

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

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

Alternative 7: 72.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{+222} \lor \neg \left(b \leq 1.4 \cdot 10^{+207}\right):\\
\;\;\;\;b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.50000000000000012e222 or 1.40000000000000005e207 < b

    1. Initial program 96.1%

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

      \[\leadsto \color{blue}{b \cdot \log c} \]
    4. Step-by-step derivation
      1. *-commutative78.6%

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

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

    if -2.50000000000000012e222 < b < 1.40000000000000005e207

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{+222} \lor \neg \left(b \leq 1.4 \cdot 10^{+207}\right):\\ \;\;\;\;b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 70.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \log c\\ \mathbf{if}\;b \leq -1.42 \cdot 10^{+222}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{+207}:\\ \;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{t\_1}{z} + 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* b (log c))))
   (if (<= b -1.42e+222)
     t_1
     (if (<= b 1.3e+207)
       (+ (* y i) (+ a (+ (* x (log y)) z)))
       (* z (+ (/ t_1 z) 1.0))))))
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 (b <= -1.42e+222) {
		tmp = t_1;
	} else if (b <= 1.3e+207) {
		tmp = (y * i) + (a + ((x * log(y)) + z));
	} else {
		tmp = z * ((t_1 / z) + 1.0);
	}
	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 (b <= (-1.42d+222)) then
        tmp = t_1
    else if (b <= 1.3d+207) then
        tmp = (y * i) + (a + ((x * log(y)) + z))
    else
        tmp = z * ((t_1 / z) + 1.0d0)
    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 (b <= -1.42e+222) {
		tmp = t_1;
	} else if (b <= 1.3e+207) {
		tmp = (y * i) + (a + ((x * Math.log(y)) + z));
	} else {
		tmp = z * ((t_1 / z) + 1.0);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = b * math.log(c)
	tmp = 0
	if b <= -1.42e+222:
		tmp = t_1
	elif b <= 1.3e+207:
		tmp = (y * i) + (a + ((x * math.log(y)) + z))
	else:
		tmp = z * ((t_1 / z) + 1.0)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(b * log(c))
	tmp = 0.0
	if (b <= -1.42e+222)
		tmp = t_1;
	elseif (b <= 1.3e+207)
		tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(x * log(y)) + z)));
	else
		tmp = Float64(z * Float64(Float64(t_1 / z) + 1.0));
	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 (b <= -1.42e+222)
		tmp = t_1;
	elseif (b <= 1.3e+207)
		tmp = (y * i) + (a + ((x * log(y)) + z));
	else
		tmp = z * ((t_1 / z) + 1.0);
	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[b, -1.42e+222], t$95$1, If[LessEqual[b, 1.3e+207], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(t$95$1 / z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b \leq -1.42 \cdot 10^{+222}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 1.3 \cdot 10^{+207}:\\
\;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{t\_1}{z} + 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.41999999999999997e222

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{b \cdot \log c} \]
    4. Step-by-step derivation
      1. *-commutative83.5%

        \[\leadsto \color{blue}{\log c \cdot b} \]
    5. Simplified83.5%

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

    if -1.41999999999999997e222 < b < 1.2999999999999999e207

    1. Initial program 99.9%

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

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

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

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

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

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

    if 1.2999999999999999e207 < b

    1. Initial program 93.6%

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

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

      \[\leadsto -1 \cdot \left(z \cdot \left(-1 \cdot \color{blue}{\frac{b \cdot \log c}{z}} - 1\right)\right) \]
    5. Step-by-step derivation
      1. *-commutative44.4%

        \[\leadsto -1 \cdot \left(z \cdot \left(-1 \cdot \frac{\color{blue}{\log c \cdot b}}{z} - 1\right)\right) \]
    6. Simplified44.4%

      \[\leadsto -1 \cdot \left(z \cdot \left(-1 \cdot \color{blue}{\frac{\log c \cdot b}{z}} - 1\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.42 \cdot 10^{+222}:\\ \;\;\;\;b \cdot \log c\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{+207}:\\ \;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{b \cdot \log c}{z} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{+131} \lor \neg \left(x \leq 4.7 \cdot 10^{+82}\right):\\
\;\;\;\;z + \left(x \cdot \log y + y \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5999999999999998e131 or 4.7e82 < x

    1. Initial program 98.7%

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

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

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

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

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

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

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

    if -9.5999999999999998e131 < x < 4.7e82

    1. Initial program 99.9%

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

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

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

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

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

      \[\leadsto \left(a + \left(z + \color{blue}{x \cdot \log y}\right)\right) + y \cdot i \]
    8. Taylor expanded in z around inf 59.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.6 \cdot 10^{+131} \lor \neg \left(x \leq 4.7 \cdot 10^{+82}\right):\\ \;\;\;\;z + \left(x \cdot \log y + y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 60.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+144} \lor \neg \left(x \leq 3.3 \cdot 10^{+195}\right):\\
\;\;\;\;a + \left(x \cdot \log y + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5500000000000001e144 or 3.3e195 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if -1.5500000000000001e144 < x < 3.3e195

    1. Initial program 99.3%

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

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

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

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

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

      \[\leadsto \left(a + \left(z + \color{blue}{x \cdot \log y}\right)\right) + y \cdot i \]
    8. Taylor expanded in z around inf 59.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{+144} \lor \neg \left(x \leq 3.3 \cdot 10^{+195}\right):\\ \;\;\;\;a + \left(x \cdot \log y + z\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 57.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+214} \lor \neg \left(x \leq 4.6 \cdot 10^{+233}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.8000000000000002e214 or 4.60000000000000001e233 < x

    1. Initial program 99.7%

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

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

    if -4.8000000000000002e214 < x < 4.60000000000000001e233

    1. Initial program 99.4%

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

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

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

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

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

      \[\leadsto \left(a + \left(z + \color{blue}{x \cdot \log y}\right)\right) + y \cdot i \]
    8. Taylor expanded in z around inf 58.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+214} \lor \neg \left(x \leq 4.6 \cdot 10^{+233}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 30.6% accurate, 12.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{-181}:\\
\;\;\;\;a\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-88}:\\
\;\;\;\;z\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-26}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.4499999999999999e-181 or 3.0999999999999998e-88 < y < 4.8000000000000002e-26

    1. Initial program 99.8%

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

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

    if 1.4499999999999999e-181 < y < 3.0999999999999998e-88

    1. Initial program 99.6%

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

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

    if 4.8000000000000002e-26 < y

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{i \cdot y} \]
    4. Step-by-step derivation
      1. *-commutative48.7%

        \[\leadsto \color{blue}{y \cdot i} \]
    5. Simplified48.7%

      \[\leadsto \color{blue}{y \cdot i} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 51.4% accurate, 31.3× speedup?

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

\\
y \cdot i + \left(z + a\right)
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

    \[\leadsto \left(a + \left(z + \color{blue}{x \cdot \log y}\right)\right) + y \cdot i \]
  8. Taylor expanded in z around inf 51.9%

    \[\leadsto \left(a + \color{blue}{z}\right) + y \cdot i \]
  9. Final simplification51.9%

    \[\leadsto y \cdot i + \left(z + a\right) \]
  10. Add Preprocessing

Alternative 14: 20.7% accurate, 36.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.55 \cdot 10^{+112}:\\
\;\;\;\;z\\

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


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

    1. Initial program 99.4%

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

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

    if 3.55e112 < a

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 16.3% 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.5%

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

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

Reproduce

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