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

Percentage Accurate: 99.8% → 99.8%
Time: 14.0s
Alternatives: 18
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 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(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.8% accurate, 1.0× speedup?

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

\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Derivation
  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. Final simplification99.9%

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

Alternative 2: 92.9% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(x + \left(y + \left(z + b \cdot -0.5\right)\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) < -1e115 or 1.99999999999999991e127 < (*.f64 (-.f64 a 1/2) b)

    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 z around 0 96.2%

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

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

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

    if -1e115 < (*.f64 (-.f64 a 1/2) b) < 1.99999999999999991e127

    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.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 a around 0 98.0%

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

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

Alternative 3: 90.1% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(x + \left(y + 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) < -1e115 or 5.0000000000000001e114 < (*.f64 (-.f64 a 1/2) b)

    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 z around 0 94.8%

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

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

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

    if -1e115 < (*.f64 (-.f64 a 1/2) b) < 5.0000000000000001e114

    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.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 a around 0 98.6%

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

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

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

Alternative 4: 85.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+125}:\\
\;\;\;\;t_1 + \left(x + y\right)\\

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


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

    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 z around 0 96.8%

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

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

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

    if -1.44999999999999997e125 < x

    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 z around 0 99.9%

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

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

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

Alternative 5: 99.9% accurate, 1.0× speedup?

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

\\
b \cdot \left(a + -0.5\right) + \left(z \cdot \left(1 - \log t\right) + \left(x + y\right)\right)
\end{array}
Derivation
  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 z around 0 99.9%

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

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

Alternative 6: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(z - z \cdot \log t\right) + \left(x + y\right)\right) + b \cdot \left(a + -0.5\right)
\end{array}
Derivation
  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. Final simplification99.9%

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

Alternative 7: 86.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+239}:\\
\;\;\;\;\left(x + z\right) - t_1\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{+60}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(x + y\right)\\

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


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

    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.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-neg99.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-eval99.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. Simplified99.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 a around 0 99.4%

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

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

      \[\leadsto \color{blue}{\left(x + z\right)} - z \cdot \log t \]
    7. Step-by-step derivation
      1. +-commutative94.8%

        \[\leadsto \color{blue}{\left(z + x\right)} - z \cdot \log t \]
    8. Simplified94.8%

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

    if -3.69999999999999998e239 < z < 5.5000000000000001e60

    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 z around 0 92.6%

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

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

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

    if 5.5000000000000001e60 < z

    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.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 a around 0 93.1%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    6. Step-by-step derivation
      1. associate-+r+93.1%

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

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

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

        \[\leadsto \left(z - \color{blue}{\log t \cdot z}\right) + \left(x + y\right) \]
    7. Applied egg-rr93.1%

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

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

Alternative 8: 85.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+239} \lor \neg \left(z \leq 3.05 \cdot 10^{+113}\right):\\
\;\;\;\;\left(x + z\right) - z \cdot \log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.99999999999999993e239 or 3.04999999999999998e113 < z

    1. Initial program 99.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+99.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-neg99.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-eval99.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. Simplified99.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 a around 0 95.1%

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

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

      \[\leadsto \color{blue}{\left(x + z\right)} - z \cdot \log t \]
    7. Step-by-step derivation
      1. +-commutative87.6%

        \[\leadsto \color{blue}{\left(z + x\right)} - z \cdot \log t \]
    8. Simplified87.6%

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

    if -7.99999999999999993e239 < z < 3.04999999999999998e113

    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 z around 0 91.0%

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

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

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

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

Alternative 9: 83.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+239} \lor \neg \left(z \leq 9.8 \cdot 10^{+113}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9999999999999999e239 or 9.80000000000000043e113 < z

    1. Initial program 99.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+99.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-neg99.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-eval99.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. Simplified99.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 a around 0 95.0%

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

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

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

    if -2.9999999999999999e239 < z < 9.80000000000000043e113

    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 z around 0 91.0%

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

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

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

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

Alternative 10: 83.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+240}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+113}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(x + y\right)\\

\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\


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

    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.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-neg99.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-eval99.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. Simplified99.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 a around 0 99.4%

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

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

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

    if -2.45e240 < z < 9.19999999999999987e113

    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 z around 0 91.0%

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

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

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

    if 9.19999999999999987e113 < z

    1. Initial program 99.6%

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

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

      \[\leadsto \color{blue}{z - z \cdot \log t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.6%

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

Alternative 11: 61.7% accurate, 12.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.25 \cdot 10^{+74} \lor \neg \left(b \leq 6.2 \cdot 10^{+46}\right):\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.25e74 or 6.1999999999999995e46 < b

    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 b around inf 69.3%

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

    if -2.25e74 < b < 6.1999999999999995e46

    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 a around 0 89.1%

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

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

      \[\leadsto \color{blue}{x + y} \]
    7. Step-by-step derivation
      1. +-commutative59.4%

        \[\leadsto \color{blue}{y + x} \]
    8. Simplified59.4%

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

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

Alternative 12: 62.5% accurate, 12.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{+162}:\\
\;\;\;\;x + b \cdot \left(a + -0.5\right)\\

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


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

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

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

    if 1.6000000000000001e162 < y

    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 a around 0 94.6%

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

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

      \[\leadsto \color{blue}{x + y} \]
    7. Step-by-step derivation
      1. +-commutative83.1%

        \[\leadsto \color{blue}{y + x} \]
    8. Simplified83.1%

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

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

Alternative 13: 64.0% accurate, 12.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a + -0.5\right)\\ \mathbf{if}\;y \leq 1.7 \cdot 10^{+25}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;y + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (+ a -0.5)))) (if (<= y 1.7e+25) (+ x t_1) (+ 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 (y <= 1.7e+25) {
		tmp = x + t_1;
	} else {
		tmp = 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 (y <= 1.7d+25) then
        tmp = x + t_1
    else
        tmp = 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 (y <= 1.7e+25) {
		tmp = x + t_1;
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a + -0.5)
	tmp = 0
	if y <= 1.7e+25:
		tmp = x + t_1
	else:
		tmp = 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 (y <= 1.7e+25)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(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 (y <= 1.7e+25)
		tmp = x + t_1;
	else
		tmp = 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[y, 1.7e+25], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{+25}:\\
\;\;\;\;x + t_1\\

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


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

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

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

    if 1.69999999999999992e25 < y

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

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

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

Alternative 14: 78.3% accurate, 12.8× speedup?

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

\\
b \cdot \left(a + -0.5\right) + \left(x + y\right)
\end{array}
Derivation
  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 z around 0 79.7%

    \[\leadsto \color{blue}{\left(x + y\right)} + \left(a + -0.5\right) \cdot b \]
  5. Step-by-step derivation
    1. +-commutative79.7%

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

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

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

Alternative 15: 27.9% accurate, 16.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.1 \cdot 10^{-46}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+161}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 5.0999999999999997e-46

    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 a around 0 79.4%

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

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

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

    if 5.0999999999999997e-46 < y < 8.50000000000000007e161

    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 a around inf 46.1%

      \[\leadsto \color{blue}{a \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative46.1%

        \[\leadsto \color{blue}{b \cdot a} \]
    6. Simplified46.1%

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

    if 8.50000000000000007e161 < y

    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 a around 0 94.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.1 \cdot 10^{-46}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+161}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 16: 50.1% accurate, 16.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.6 \cdot 10^{+150}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;b \leq 2.2 \cdot 10^{+129}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.59999999999999986e150 or 2.1999999999999999e129 < b

    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 a around inf 52.9%

      \[\leadsto \color{blue}{a \cdot b} \]
    5. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto \color{blue}{b \cdot a} \]
    6. Simplified52.9%

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

    if -3.59999999999999986e150 < b < 2.1999999999999999e129

    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 a around 0 86.3%

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

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

      \[\leadsto \color{blue}{x + y} \]
    7. Step-by-step derivation
      1. +-commutative55.9%

        \[\leadsto \color{blue}{y + x} \]
    8. Simplified55.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.6 \cdot 10^{+150}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{+129}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 17: 27.4% accurate, 37.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{+25}:\\
\;\;\;\;x\\

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


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

    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 a around 0 77.8%

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

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

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

    if 1.19999999999999998e25 < y

    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 a around 0 75.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.2 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 18: 21.6% 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.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 a around 0 77.3%

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

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification23.5%

    \[\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 2023297 
(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)))