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

Percentage Accurate: 99.8% → 99.8%
Time: 17.1s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + 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) (+ z (fma x (log y) (+ t 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), (z + fma(x, log(y), (t + a)))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(z + fma(x, log(y), Float64(t + 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[(z + N[(x * N[Log[y], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + 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-+l+99.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, i, \left(\left(\left(x \cdot \log y + a\right) + t\right) + z\right) + \left(b - 0.5\right) \cdot \log c\right)} \]
    11. +-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 + a\right) + t\right) + z\right)}\right) \]
    12. fma-define99.9%

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

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

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

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

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

Alternative 2: 98.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.9 \cdot 10^{+133} \lor \neg \left(x \leq 3.5 \cdot 10^{-26}\right):\\
\;\;\;\;y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.90000000000000025e133 or 3.49999999999999985e-26 < x

    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 inf 99.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 \]
    4. Step-by-step derivation
      1. *-commutative99.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. Simplified99.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 \]

    if -8.90000000000000025e133 < x < 3.49999999999999985e-26

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 4: 89.0% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -4 \cdot 10^{+216} \lor \neg \left(b - 0.5 \leq 2 \cdot 10^{+233}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b #s(literal 1/2 binary64)) < -4.0000000000000001e216 or 1.99999999999999995e233 < (-.f64 b #s(literal 1/2 binary64))

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{b \cdot \log c}{x}} + y \cdot i \]
    7. Step-by-step derivation
      1. *-commutative51.8%

        \[\leadsto x \cdot \frac{\color{blue}{\log c \cdot b}}{x} + y \cdot i \]
    8. Simplified51.8%

      \[\leadsto x \cdot \color{blue}{\frac{\log c \cdot b}{x}} + y \cdot i \]
    9. Taylor expanded in x around 0 85.4%

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

    if -4.0000000000000001e216 < (-.f64 b #s(literal 1/2 binary64)) < 1.99999999999999995e233

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative95.4%

        \[\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. Simplified95.4%

      \[\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 \]
    6. Taylor expanded in b around 0 88.7%

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

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

Alternative 5: 95.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{+134} \lor \neg \left(x \leq 3.3 \cdot 10^{+59}\right):\\
\;\;\;\;\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.04999999999999989e134 or 3.2999999999999999e59 < 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 inf 99.8%

      \[\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 \]
    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 b}\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 b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 93.2%

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

    if -3.04999999999999989e134 < x < 3.2999999999999999e59

    1. Initial program 99.9%

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

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

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

Alternative 6: 74.2% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;y \leq 3.55 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \log y + y \cdot i\\

\mathbf{elif}\;y \leq 5.6 \cdot 10^{+54}:\\
\;\;\;\;a + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 2.8e7

    1. Initial program 99.9%

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

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

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

    if 2.8e7 < y < 3.5500000000000001e22

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

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

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

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

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

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

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

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

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

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

    if 3.5500000000000001e22 < y < 5.6000000000000003e54

    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 0 77.7%

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

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

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

    if 5.6000000000000003e54 < y

    1. Initial program 100.0%

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative97.4%

        \[\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. Simplified97.4%

      \[\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 \]
    6. Taylor expanded in b around 0 87.0%

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

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

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

Alternative 7: 64.9% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \log y + y \cdot i\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.5e7 or 4.4999999999999998e22 < y < 5.20000000000000013e54

    1. Initial program 99.9%

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

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

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

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

    if 2.5e7 < y < 4.4999999999999998e22

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000013e54 < y

    1. Initial program 100.0%

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative97.4%

        \[\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. Simplified97.4%

      \[\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 \]
    6. Taylor expanded in b around 0 87.0%

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

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

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

Alternative 8: 74.6% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.09999999999999998e212 or 2.44999999999999998e213 < b

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{b \cdot \log c}{x}} + y \cdot i \]
    7. Step-by-step derivation
      1. *-commutative49.7%

        \[\leadsto x \cdot \frac{\color{blue}{\log c \cdot b}}{x} + y \cdot i \]
    8. Simplified49.7%

      \[\leadsto x \cdot \color{blue}{\frac{\log c \cdot b}{x}} + y \cdot i \]
    9. Taylor expanded in x around 0 82.8%

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

    if -3.09999999999999998e212 < b < 2.44999999999999998e213

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative95.4%

        \[\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. Simplified95.4%

      \[\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 \]
    6. Taylor expanded in b around 0 89.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.1 \cdot 10^{+212} \lor \neg \left(b \leq 2.45 \cdot 10^{+213}\right):\\ \;\;\;\;y \cdot i + b \cdot \log c\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 74.3% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.1 \cdot 10^{+54}:\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.10000000000000009e54

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative95.2%

        \[\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. Simplified95.2%

      \[\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 \]
    6. Taylor expanded in b around 0 71.6%

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

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

    if 5.10000000000000009e54 < y

    1. Initial program 100.0%

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative97.4%

        \[\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. Simplified97.4%

      \[\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 \]
    6. Taylor expanded in b around 0 87.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.1 \cdot 10^{+54}:\\ \;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.6% accurate, 1.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.79999999999999983e220 or 1.20000000000000007e199 < x

    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 inf 99.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 \]
    4. Step-by-step derivation
      1. *-commutative99.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. Simplified99.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 \]
    6. Taylor expanded in b around 0 95.1%

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

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

    if -5.79999999999999983e220 < x < 1.20000000000000007e199

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

      \[\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 \]
    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 b}\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 b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 75.9%

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

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

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

Alternative 11: 43.2% accurate, 21.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 7 \cdot 10^{+153}:\\ \;\;\;\;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 (<= a 7e+153) (+ 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 (a <= 7e+153) {
		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 (a <= 7d+153) 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 (a <= 7e+153) {
		tmp = z + (y * i);
	} else {
		tmp = a + (y * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if a <= 7e+153:
		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 (a <= 7e+153)
		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 (a <= 7e+153)
		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[a, 7e+153], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 7 \cdot 10^{+153}:\\
\;\;\;\;z + y \cdot i\\

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


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

    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 z around inf 43.9%

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

    if 6.9999999999999998e153 < a

    1. Initial program 100.0%

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

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

Alternative 12: 41.1% accurate, 21.9× speedup?

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

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

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


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

    1. Initial program 100.0%

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative100.0%

        \[\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. Simplified100.0%

      \[\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 \]
    6. Taylor expanded in b around 0 87.2%

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

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

    if -2.50000000000000009e200 < 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. Add Preprocessing
    3. Taylor expanded in a around inf 37.9%

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

Alternative 13: 67.4% accurate, 24.3× speedup?

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

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

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

    \[\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 \]
  4. Step-by-step derivation
    1. *-commutative96.2%

      \[\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. Simplified96.2%

    \[\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 \]
  6. Taylor expanded in b around 0 78.4%

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

    \[\leadsto \color{blue}{a + \left(t + \left(z + i \cdot y\right)\right)} \]
  8. Final simplification63.4%

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

Alternative 14: 30.4% accurate, 27.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{+63}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.4499999999999998e63

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

      \[\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 \]
    4. Step-by-step derivation
      1. *-commutative95.4%

        \[\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. Simplified95.4%

      \[\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 \]
    6. Taylor expanded in b around 0 72.0%

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

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

    if 2.4499999999999998e63 < y

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.45 \cdot 10^{+63}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 20.8% accurate, 36.4× speedup?

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

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

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


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

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

      \[\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 \]
    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 b}\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 b}\right) + y \cdot i \]
    6. Taylor expanded in b around 0 76.9%

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

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

    if 2.19999999999999999e150 < a

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{a} + y \cdot i \]
    4. Taylor expanded in a around inf 39.6%

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

Alternative 16: 16.2% 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. Add Preprocessing
  3. Taylor expanded in a around inf 34.9%

    \[\leadsto \color{blue}{a} + y \cdot i \]
  4. Taylor expanded in a around inf 11.7%

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

Reproduce

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