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

Percentage Accurate: 99.9% → 99.9%
Time: 9.3s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\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 14 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ x (fma z (- 1.0 (log t)) (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
	return x + fma(z, (1.0 - log(t)), fma((a + -0.5), b, y));
}
function code(x, y, z, t, a, b)
	return Float64(x + fma(z, Float64(1.0 - log(t)), fma(Float64(a + -0.5), b, y)))
end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    9. cancel-sign-sub-inv99.5%

      \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
    10. distribute-rgt1-in99.5%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+67} \lor \neg \left(t_1 \leq 10^{+38}\right):\\
\;\;\;\;\left(x + y\right) + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -1.99999999999999997e67 or 9.99999999999999977e37 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.2%

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

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

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

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

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

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

    if -1.99999999999999997e67 < (*.f64 (-.f64 a 1/2) b) < 9.99999999999999977e37

    1. Initial program 99.8%

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

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

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

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

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

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

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

Alternative 3: 83.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 5 \cdot 10^{+55}:\\
\;\;\;\;\left(t_1 + \left(x + z\right)\right) - z \cdot \log t\\

\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 5.00000000000000046e55

    1. Initial program 99.9%

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

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

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

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

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

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

    if 5.00000000000000046e55 < (+.f64 x y)

    1. Initial program 98.7%

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

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

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

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

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

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

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

Alternative 4: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 5: 84.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+243} \lor \neg \left(z \leq -4.5 \cdot 10^{+227}\right) \land \left(z \leq -8.2 \cdot 10^{+175} \lor \neg \left(z \leq 1.65 \cdot 10^{+201}\right)\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.99999999999999969e243 or -4.5e227 < z < -8.19999999999999955e175 or 1.65e201 < z

    1. Initial program 97.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]

    if -5.99999999999999969e243 < z < -4.5e227 or -8.19999999999999955e175 < z < 1.65e201

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+243} \lor \neg \left(z \leq -4.5 \cdot 10^{+227}\right) \land \left(z \leq -8.2 \cdot 10^{+175} \lor \neg \left(z \leq 1.65 \cdot 10^{+201}\right)\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]

Alternative 6: 83.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+241}:\\ \;\;\;\;z - z \cdot \log t\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+227} \lor \neg \left(z \leq -3.1 \cdot 10^{+175}\right) \land z \leq 2 \cdot 10^{+194}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.1e+241)
   (- z (* z (log t)))
   (if (or (<= z -3.2e+227) (and (not (<= z -3.1e+175)) (<= z 2e+194)))
     (+ (+ x y) (* b (- a 0.5)))
     (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.1e+241) {
		tmp = z - (z * log(t));
	} else if ((z <= -3.2e+227) || (!(z <= -3.1e+175) && (z <= 2e+194))) {
		tmp = (x + y) + (b * (a - 0.5));
	} else {
		tmp = z * (1.0 - log(t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-4.1d+241)) then
        tmp = z - (z * log(t))
    else if ((z <= (-3.2d+227)) .or. (.not. (z <= (-3.1d+175))) .and. (z <= 2d+194)) then
        tmp = (x + y) + (b * (a - 0.5d0))
    else
        tmp = z * (1.0d0 - log(t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.1e+241) {
		tmp = z - (z * Math.log(t));
	} else if ((z <= -3.2e+227) || (!(z <= -3.1e+175) && (z <= 2e+194))) {
		tmp = (x + y) + (b * (a - 0.5));
	} else {
		tmp = z * (1.0 - Math.log(t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4.1e+241:
		tmp = z - (z * math.log(t))
	elif (z <= -3.2e+227) or (not (z <= -3.1e+175) and (z <= 2e+194)):
		tmp = (x + y) + (b * (a - 0.5))
	else:
		tmp = z * (1.0 - math.log(t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.1e+241)
		tmp = Float64(z - Float64(z * log(t)));
	elseif ((z <= -3.2e+227) || (!(z <= -3.1e+175) && (z <= 2e+194)))
		tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5)));
	else
		tmp = Float64(z * Float64(1.0 - log(t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4.1e+241)
		tmp = z - (z * log(t));
	elseif ((z <= -3.2e+227) || (~((z <= -3.1e+175)) && (z <= 2e+194)))
		tmp = (x + y) + (b * (a - 0.5));
	else
		tmp = z * (1.0 - log(t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.1e+241], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.2e+227], And[N[Not[LessEqual[z, -3.1e+175]], $MachinePrecision], LessEqual[z, 2e+194]]], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+241}:\\
\;\;\;\;z - z \cdot \log t\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+227} \lor \neg \left(z \leq -3.1 \cdot 10^{+175}\right) \land z \leq 2 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\


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

    1. Initial program 99.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(z + x\right) - z \cdot \log t} \]
    6. Taylor expanded in z around inf 72.2%

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative72.2%

        \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} \]
      2. sub-neg72.2%

        \[\leadsto z \cdot \color{blue}{\left(1 + \left(-\log t\right)\right)} \]
      3. log-rec72.2%

        \[\leadsto z \cdot \left(1 + \color{blue}{\log \left(\frac{1}{t}\right)}\right) \]
      4. distribute-rgt-in72.4%

        \[\leadsto \color{blue}{1 \cdot z + \log \left(\frac{1}{t}\right) \cdot z} \]
      5. *-lft-identity72.4%

        \[\leadsto \color{blue}{z} + \log \left(\frac{1}{t}\right) \cdot z \]
      6. log-rec72.4%

        \[\leadsto z + \color{blue}{\left(-\log t\right)} \cdot z \]
      7. cancel-sign-sub-inv72.4%

        \[\leadsto \color{blue}{z - \log t \cdot z} \]
    8. Simplified72.4%

      \[\leadsto \color{blue}{z - \log t \cdot z} \]

    if -4.10000000000000015e241 < z < -3.19999999999999988e227 or -3.09999999999999984e175 < z < 1.99999999999999989e194

    1. Initial program 99.9%

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

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

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

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

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

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

    if -3.19999999999999988e227 < z < -3.09999999999999984e175 or 1.99999999999999989e194 < z

    1. Initial program 96.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 - \log t\right) \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+241}:\\ \;\;\;\;z - z \cdot \log t\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+227} \lor \neg \left(z \leq -3.1 \cdot 10^{+175}\right) \land z \leq 2 \cdot 10^{+194}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \end{array} \]

Alternative 7: 85.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+174} \lor \neg \left(z \leq 1.7 \cdot 10^{+203}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7000000000000002e174 or 1.7000000000000001e203 < z

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv97.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in97.8%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative97.8%

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

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

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

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

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

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

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

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

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

    if -3.7000000000000002e174 < z < 1.7000000000000001e203

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+174} \lor \neg \left(z \leq 1.7 \cdot 10^{+203}\right):\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\ \end{array} \]

Alternative 8: 69.1% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+99} \lor \neg \left(t_1 \leq 5 \cdot 10^{-14}\right):\\
\;\;\;\;x + t_1\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -1.9999999999999999e99 or 5.0000000000000002e-14 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.2%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.2%

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e99 < (*.f64 (-.f64 a 1/2) b) < 5.0000000000000002e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot \left(a - 0.5\right) \leq -2 \cdot 10^{+99} \lor \neg \left(b \cdot \left(a - 0.5\right) \leq 5 \cdot 10^{-14}\right):\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 71.7% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+212} \lor \neg \left(t_1 \leq 5 \cdot 10^{+81}\right):\\
\;\;\;\;x + t_1\\

\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999992e212 or 4.9999999999999998e81 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv98.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in98.9%

        \[\leadsto x + \left(\color{blue}{\left(\left(-\log t\right) + 1\right) \cdot z} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      11. *-commutative98.9%

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

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

        \[\leadsto x + \mathsf{fma}\left(z, \color{blue}{1 + \left(-\log t\right)}, \left(a - 0.5\right) \cdot b + y\right) \]
      14. unsub-neg100.0%

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

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \color{blue}{\mathsf{fma}\left(a - 0.5, b, y\right)}\right) \]
      16. sub-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(\color{blue}{a + \left(-0.5\right)}, b, y\right)\right) \]
      17. metadata-eval100.0%

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

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

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

    if -4.99999999999999992e212 < (*.f64 (-.f64 a 1/2) b) < 4.9999999999999998e81

    1. Initial program 99.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
    5. Taylor expanded in a around 0 67.2%

      \[\leadsto \color{blue}{-0.5 \cdot b} + \left(y + x\right) \]
    6. Step-by-step derivation
      1. *-commutative67.2%

        \[\leadsto \color{blue}{b \cdot -0.5} + \left(y + x\right) \]
    7. Simplified67.2%

      \[\leadsto \color{blue}{b \cdot -0.5} + \left(y + x\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot \left(a - 0.5\right) \leq -5 \cdot 10^{+212} \lor \neg \left(b \cdot \left(a - 0.5\right) \leq 5 \cdot 10^{+81}\right):\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + -0.5 \cdot b\\ \end{array} \]

Alternative 10: 63.6% accurate, 6.7× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+212} \lor \neg \left(t_1 \leq 10^{+37}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999992e212 or 9.99999999999999954e36 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

    if -4.99999999999999992e212 < (*.f64 (-.f64 a 1/2) b) < 9.99999999999999954e36

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.8%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot \left(a - 0.5\right) \leq -5 \cdot 10^{+212} \lor \neg \left(b \cdot \left(a - 0.5\right) \leq 10^{+37}\right):\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 11: 52.0% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.16 \cdot 10^{+93} \lor \neg \left(a \leq 8.2 \cdot 10^{+108}\right) \land \left(a \leq 1.3 \cdot 10^{+152} \lor \neg \left(a \leq 4.2 \cdot 10^{+201}\right)\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -1.16e+93)
         (and (not (<= a 8.2e+108))
              (or (<= a 1.3e+152) (not (<= a 4.2e+201)))))
   (* a b)
   (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.16e+93) || (!(a <= 8.2e+108) && ((a <= 1.3e+152) || !(a <= 4.2e+201)))) {
		tmp = a * b;
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((a <= (-1.16d+93)) .or. (.not. (a <= 8.2d+108)) .and. (a <= 1.3d+152) .or. (.not. (a <= 4.2d+201))) then
        tmp = a * b
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.16e+93) || (!(a <= 8.2e+108) && ((a <= 1.3e+152) || !(a <= 4.2e+201)))) {
		tmp = a * b;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.16e+93) or (not (a <= 8.2e+108) and ((a <= 1.3e+152) or not (a <= 4.2e+201))):
		tmp = a * b
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -1.16e+93) || (!(a <= 8.2e+108) && ((a <= 1.3e+152) || !(a <= 4.2e+201))))
		tmp = Float64(a * b);
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -1.16e+93) || (~((a <= 8.2e+108)) && ((a <= 1.3e+152) || ~((a <= 4.2e+201)))))
		tmp = a * b;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.16e+93], And[N[Not[LessEqual[a, 8.2e+108]], $MachinePrecision], Or[LessEqual[a, 1.3e+152], N[Not[LessEqual[a, 4.2e+201]], $MachinePrecision]]]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.16 \cdot 10^{+93} \lor \neg \left(a \leq 8.2 \cdot 10^{+108}\right) \land \left(a \leq 1.3 \cdot 10^{+152} \lor \neg \left(a \leq 4.2 \cdot 10^{+201}\right)\right):\\
\;\;\;\;a \cdot b\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.16e93 or 8.1999999999999998e108 < a < 1.3e152 or 4.1999999999999998e201 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.9%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{a \cdot b} \]
    5. Taylor expanded in x around 0 78.8%

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

    if -1.16e93 < a < 8.1999999999999998e108 or 1.3e152 < a < 4.1999999999999998e201

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.4%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.16 \cdot 10^{+93} \lor \neg \left(a \leq 8.2 \cdot 10^{+108}\right) \land \left(a \leq 1.3 \cdot 10^{+152} \lor \neg \left(a \leq 4.2 \cdot 10^{+201}\right)\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 12: 78.8% accurate, 12.8× speedup?

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

\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

    \[\leadsto \color{blue}{\left(a - 0.5\right) \cdot b + \left(y + x\right)} \]
  5. Final simplification78.8%

    \[\leadsto \left(x + y\right) + b \cdot \left(a - 0.5\right) \]

Alternative 13: 31.7% accurate, 22.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+99}:\\
\;\;\;\;x\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -3.4999999999999998e99 < x

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(z - \color{blue}{\log t \cdot z}\right) + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      9. cancel-sign-sub-inv99.4%

        \[\leadsto x + \left(\color{blue}{\left(z + \left(-\log t\right) \cdot z\right)} + \left(\left(a - 0.5\right) \cdot b + y\right)\right) \]
      10. distribute-rgt1-in99.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{a \cdot b} \]
    5. Taylor expanded in x around 0 28.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{+99}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 14: 21.8% accurate, 115.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    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
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.5%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification25.3%

    \[\leadsto x \]

Developer target: 99.5% accurate, 0.4× speedup?

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

\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}

Reproduce

?
herbie shell --seed 2023192 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))

  (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))