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

Percentage Accurate: 99.8% → 99.8%
Time: 14.5s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 3: 98.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 4: 92.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot i + \left(z + \mathsf{fma}\left(x, \log y, a\right)\right)\\

\mathbf{elif}\;x \leq 3.6 \cdot 10^{+92}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\

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


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

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

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

        \[\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. associate-+l+99.7%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative97.7%

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(x, \log y, a\right)} + z\right) + y \cdot i \]
      5. +-commutative89.5%

        \[\leadsto \color{blue}{\left(z + \mathsf{fma}\left(x, \log y, a\right)\right)} + y \cdot i \]
    9. Simplified89.5%

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

    if -2.09999999999999992e127 < x < 3.6e92

    1. Initial program 99.9%

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

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

    if 3.6e92 < 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. 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. associate-+l+99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    6. Simplified92.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+127}:\\ \;\;\;\;y \cdot i + \left(z + \mathsf{fma}\left(x, \log y, a\right)\right)\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{+92}:\\ \;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(a + \left(z + x \cdot \log y\right)\right)\\ \end{array} \]

Alternative 5: 89.5% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -2e164 or 2.50000000000000004e204 < (-.f64 b 1/2)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e164 < (-.f64 b 1/2) < 2.50000000000000004e204

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
    2. Taylor expanded in b around inf 97.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 \]
    3. Step-by-step derivation
      1. *-commutative97.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 \]
    4. Simplified97.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. Taylor expanded in b around 0 93.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 simplification92.2%

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

Alternative 6: 76.0% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 b 1/2) < -2e164 or 2.50000000000000004e204 < (-.f64 b 1/2)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e164 < (-.f64 b 1/2) < 2.50000000000000004e204

    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. associate-+l+99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative93.8%

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

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

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

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

Alternative 7: 92.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.34 \cdot 10^{+132} \lor \neg \left(x \leq 1.5 \cdot 10^{+91}\right):\\ \;\;\;\;y \cdot i + \left(a + \left(z + 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} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= x -1.34e+132) (not (<= x 1.5e+91)))
   (+ (* y i) (+ a (+ z (* x (log y)))))
   (+ (* 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.34e+132) || !(x <= 1.5e+91)) {
		tmp = (y * i) + (a + (z + (x * log(y))));
	} 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.34d+132)) .or. (.not. (x <= 1.5d+91))) then
        tmp = (y * i) + (a + (z + (x * log(y))))
    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.34e+132) || !(x <= 1.5e+91)) {
		tmp = (y * i) + (a + (z + (x * Math.log(y))));
	} 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.34e+132) or not (x <= 1.5e+91):
		tmp = (y * i) + (a + (z + (x * math.log(y))))
	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.34e+132) || !(x <= 1.5e+91))
		tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(x * log(y)))));
	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.34e+132) || ~((x <= 1.5e+91)))
		tmp = (y * i) + (a + (z + (x * log(y))));
	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.34e+132], N[Not[LessEqual[x, 1.5e+91]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.34 \cdot 10^{+132} \lor \neg \left(x \leq 1.5 \cdot 10^{+91}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(z + 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}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.34000000000000002e132 or 1.50000000000000003e91 < 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. Step-by-step derivation
      1. associate-+l+99.8%

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

        \[\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. associate-+l+99.8%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative94.7%

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

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

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

    if -1.34000000000000002e132 < x < 1.50000000000000003e91

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.34 \cdot 10^{+132} \lor \neg \left(x \leq 1.5 \cdot 10^{+91}\right):\\ \;\;\;\;y \cdot i + \left(a + \left(z + 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} \]

Alternative 8: 80.4% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+126} \lor \neg \left(x \leq 2.8 \cdot 10^{+90}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(z + x \cdot \log y\right)\right)\\

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


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

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

        \[\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. associate-+l+99.8%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative94.7%

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

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

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

    if -8.99999999999999947e126 < x < 2.8e90

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.2% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;a \leq 6.5 \cdot 10^{+209}:\\
\;\;\;\;y \cdot i + \left(a + \log c \cdot \left(b - 0.5\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.8499999999999999e101

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8499999999999999e101 < a < 6.49999999999999975e209

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.49999999999999975e209 < 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. Taylor expanded in t around 0 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.4% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;a \leq 5.7 \cdot 10^{+153} \lor \neg \left(a \leq 1.95 \cdot 10^{+180}\right):\\
\;\;\;\;y \cdot i + \left(z + a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 2.10000000000000017e56

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000017e56 < a < 5.69999999999999987e153 or 1.95e180 < 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. Taylor expanded in t around 0 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.69999999999999987e153 < a < 1.95e180

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.1 \cdot 10^{+56}:\\ \;\;\;\;y \cdot i + \left(z + x \cdot \log y\right)\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{+153} \lor \neg \left(a \leq 1.95 \cdot 10^{+180}\right):\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \mathbf{else}:\\ \;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\ \end{array} \]

Alternative 11: 72.5% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := z + t_1\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+229}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq -5.5 \cdot 10^{+185}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 7.5 \cdot 10^{+221}:\\
\;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.80000000000000018e229 or -1.40000000000000005e207 < x < -5.4999999999999996e185

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000018e229 < x < -1.40000000000000005e207

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999996e185 < x < 7.50000000000000035e221

    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. associate-+l+99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative83.1%

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    6. Simplified83.1%

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

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

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

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

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

    if 7.50000000000000035e221 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
    7. Taylor expanded in x around inf 74.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{+229}:\\ \;\;\;\;z + x \cdot \log y\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{+207}:\\ \;\;\;\;y \cdot i + \left(z + a\right)\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{+185}:\\ \;\;\;\;z + x \cdot \log y\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+221}:\\ \;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]

Alternative 12: 74.0% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+227}:\\
\;\;\;\;z + t_1\\

\mathbf{elif}\;x \leq 3.2 \cdot 10^{+215}:\\
\;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\

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


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

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999994e227 < x < 3.1999999999999999e215

    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. associate-+l+99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative84.1%

        \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
    6. Simplified84.1%

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

      \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
    8. Step-by-step derivation
      1. +-commutative77.2%

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

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

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

    if 3.1999999999999999e215 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+227}:\\ \;\;\;\;z + x \cdot \log y\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+215}:\\ \;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + x \cdot \log y\\ \end{array} \]

Alternative 13: 72.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+250} \lor \neg \left(x \leq 1.35 \cdot 10^{+223}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.0000000000000002e250 or 1.35e223 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + y \cdot i \]
    7. Taylor expanded in x around inf 80.4%

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

    if -5.0000000000000002e250 < x < 1.35e223

    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. associate-+l+99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative84.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+250} \lor \neg \left(x \leq 1.35 \cdot 10^{+223}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\ \end{array} \]

Alternative 14: 67.7% accurate, 24.3× speedup?

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

\\
y \cdot i + \left(t + \left(z + 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. 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. associate-+l+99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{i \cdot y} \]
  5. Step-by-step derivation
    1. *-commutative85.5%

      \[\leadsto \left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \color{blue}{y \cdot i} \]
  6. Simplified85.5%

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

    \[\leadsto \color{blue}{\left(a + \left(t + z\right)\right)} + y \cdot i \]
  8. Step-by-step derivation
    1. +-commutative72.0%

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

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

    \[\leadsto \color{blue}{\left(t + \left(z + a\right)\right)} + y \cdot i \]
  10. Final simplification72.0%

    \[\leadsto y \cdot i + \left(t + \left(z + a\right)\right) \]

Alternative 15: 44.6% accurate, 31.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.40000000000000032e79 < z

    1. Initial program 99.9%

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

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

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

Alternative 16: 53.6% 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. Taylor expanded in t around 0 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto y \cdot i + \left(z + a\right) \]

Alternative 17: 40.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. Taylor expanded in a around inf 43.3%

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot i} \]
  5. Simplified27.0%

    \[\leadsto \color{blue}{y \cdot i} \]
  6. Final simplification27.0%

    \[\leadsto y \cdot i \]

Reproduce

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