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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 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. associate-+l+99.9%

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

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

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

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

      \[\leadsto \left(z + \color{blue}{\left(\left(x \cdot \log y + a\right) + t\right)}\right) + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right) \]
    7. +-commutative99.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-def99.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-def99.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. Final simplification99.9%

    \[\leadsto \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) \]
  6. Add Preprocessing

Alternative 2: 91.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+88} \lor \neg \left(x \leq 4.5 \cdot 10^{+157}\right):\\
\;\;\;\;y \cdot i + \left(t\_1 + \left(a + x \cdot \log y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1e88 or 4.49999999999999985e157 < 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. Step-by-step derivation
      1. associate-+l+99.8%

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

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

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

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

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

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

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

      \[\leadsto \left({\color{blue}{\left(\sqrt{a + \left(z + x \cdot \log y\right)}\right)}}^{2} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    6. Step-by-step derivation
      1. associate-+r+52.4%

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

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

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

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

    if -2.1e88 < x < 4.49999999999999985e157

    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 \left(\color{blue}{\left(a + \left(t + z\right)\right)} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.7%

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

Alternative 3: 80.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.5000000000000001e-4

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l+99.9%

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

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

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

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

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

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

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

      \[\leadsto \left({\color{blue}{\left(\sqrt{a + \left(z + x \cdot \log y\right)}\right)}}^{2} + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    6. Step-by-step derivation
      1. associate-+r+31.6%

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

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

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

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

    if 2.5000000000000001e-4 < 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 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. *-commutative87.7%

        \[\leadsto \left(\left(a + \left(t + z\right)\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 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.6%

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

Alternative 4: 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 5: 61.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+223} \lor \neg \left(b - 0.5 \leq 5 \cdot 10^{+232}\right):\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -1.00000000000000005e223 or 4.99999999999999987e232 < (-.f64 b 1/2)

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

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

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

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

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

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

        \[\leadsto \left(\left(z + \color{blue}{\left(\log c \cdot b + \log c \cdot -0.5\right)}\right) + a\right) + y \cdot i \]
      5. distribute-lft-in95.8%

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

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

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

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

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

    if -1.00000000000000005e223 < (-.f64 b 1/2) < 4.99999999999999987e232

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+253} \lor \neg \left(x \leq 2.8 \cdot 10^{+227}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.32e253 or 2.79999999999999984e227 < x

    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 x around inf 87.2%

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

    if -1.32e253 < x < 2.79999999999999984e227

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

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

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

Alternative 7: 88.3% accurate, 1.8× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(b \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.32e253 or 5.8999999999999998e225 < x

    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 x around inf 87.2%

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

    if -1.32e253 < x < 5.8999999999999998e225

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

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

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

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

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

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

Alternative 8: 75.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.38 \cdot 10^{+253} \lor \neg \left(x \leq 1.25 \cdot 10^{+227}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.38e253 or 1.2499999999999999e227 < x

    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 x around inf 87.2%

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

    if -1.38e253 < x < 1.2499999999999999e227

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

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

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

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

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

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

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

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

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

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

Alternative 9: 73.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{+218} \lor \neg \left(b \leq 2.6 \cdot 10^{+232}\right):\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.59999999999999996e218 or 2.59999999999999973e232 < b

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \left(\left(z + \color{blue}{\left(\log c \cdot b + \log c \cdot -0.5\right)}\right) + a\right) + y \cdot i \]
      5. distribute-lft-in95.8%

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

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

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

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

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

    if -6.59999999999999996e218 < b < 2.59999999999999973e232

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
    7. Step-by-step derivation
      1. associate-+r+78.5%

        \[\leadsto \color{blue}{\left(\left(a + t\right) + z\right)} + y \cdot i \]
      2. +-commutative78.5%

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

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

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

Alternative 10: 73.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+137} \lor \neg \left(x \leq 5.4 \cdot 10^{+225}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.89999999999999985e137 or 5.3999999999999997e225 < 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 73.1%

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

    if -2.89999999999999985e137 < x < 5.3999999999999997e225

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

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

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

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

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

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

        \[\leadsto \left(\left(a + \left(t + z\right)\right) + {\left(\sqrt[3]{\color{blue}{\log c \cdot \left(b + -0.5\right)}}\right)}^{3}\right) + y \cdot i \]
    5. Applied egg-rr95.8%

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

      \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
    7. Step-by-step derivation
      1. associate-+r+79.1%

        \[\leadsto \color{blue}{\left(\left(a + t\right) + z\right)} + y \cdot i \]
      2. +-commutative79.1%

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

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

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

Alternative 11: 61.4% accurate, 1.9× speedup?

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

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

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


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

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

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

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

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

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

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

        \[\leadsto \left(\left(t + z\right) + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right) + y \cdot i \]
      5. distribute-lft-out72.6%

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

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

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

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

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

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

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

    if 1.15e23 < 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 x around 0 87.1%

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

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

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

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

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

        \[\leadsto \left(\left(a + \left(t + z\right)\right) + {\left(\sqrt[3]{\color{blue}{\log c \cdot \left(b + -0.5\right)}}\right)}^{3}\right) + y \cdot i \]
    5. Applied egg-rr86.8%

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

      \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
    7. Step-by-step derivation
      1. associate-+r+71.3%

        \[\leadsto \color{blue}{\left(\left(a + t\right) + z\right)} + y \cdot i \]
      2. +-commutative71.3%

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

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

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

Alternative 12: 43.1% accurate, 21.9× speedup?

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

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

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


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

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

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

    if -9.79999999999999943e87 < 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 43.2%

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

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

Alternative 13: 67.0% accurate, 24.3× speedup?

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

\\
y \cdot i + \left(z + \left(t + a\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 x around 0 86.5%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
  7. Step-by-step derivation
    1. associate-+r+71.2%

      \[\leadsto \color{blue}{\left(\left(a + t\right) + z\right)} + y \cdot i \]
    2. +-commutative71.2%

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

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

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

Alternative 14: 52.8% 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.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 86.5%

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

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

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

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

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

      \[\leadsto \left(\left(z + \color{blue}{\left(\log c \cdot b + \log c \cdot -0.5\right)}\right) + a\right) + y \cdot i \]
    5. distribute-lft-in69.6%

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

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

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

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

Alternative 15: 38.4% accurate, 43.8× speedup?

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

\\
a + y \cdot i
\end{array}
Derivation
  1. Initial program 99.9%

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

    \[\leadsto \color{blue}{a} + y \cdot i \]
  4. Final simplification41.2%

    \[\leadsto a + y \cdot i \]
  5. Add Preprocessing

Alternative 16: 23.9% accurate, 73.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \left(\left(t + z\right) + \log c \cdot \color{blue}{\left(-0.5 + b\right)}\right) + y \cdot i \]
    5. distribute-lft-out68.7%

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

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

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

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

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

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

    \[\leadsto \color{blue}{i \cdot y} \]
  8. Final simplification24.7%

    \[\leadsto y \cdot i \]
  9. Add Preprocessing

Reproduce

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