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

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

\\
\left(x + \left(y + \left(z + \left(-0.5 \cdot b + b \cdot a\right)\right)\right)\right) - z \cdot \log t
\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. Taylor expanded in a around 0 99.9%

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

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

Alternative 2: 91.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+47} \lor \neg \left(t_1 \leq 2 \cdot 10^{+52}\right):\\ \;\;\;\;\left(x + y\right) + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(x + \left(y + \left(z + -0.5 \cdot b\right)\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 -5e+47) (not (<= t_1 2e+52)))
     (+ (+ x y) t_1)
     (- (+ x (+ y (+ z (* -0.5 b)))) (* 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 <= -5e+47) || !(t_1 <= 2e+52)) {
		tmp = (x + y) + t_1;
	} else {
		tmp = (x + (y + (z + (-0.5 * b)))) - (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 <= (-5d+47)) .or. (.not. (t_1 <= 2d+52))) then
        tmp = (x + y) + t_1
    else
        tmp = (x + (y + (z + ((-0.5d0) * b)))) - (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 <= -5e+47) || !(t_1 <= 2e+52)) {
		tmp = (x + y) + t_1;
	} else {
		tmp = (x + (y + (z + (-0.5 * b)))) - (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 <= -5e+47) or not (t_1 <= 2e+52):
		tmp = (x + y) + t_1
	else:
		tmp = (x + (y + (z + (-0.5 * b)))) - (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 <= -5e+47) || !(t_1 <= 2e+52))
		tmp = Float64(Float64(x + y) + t_1);
	else
		tmp = Float64(Float64(x + Float64(y + Float64(z + Float64(-0.5 * b)))) - 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 <= -5e+47) || ~((t_1 <= 2e+52)))
		tmp = (x + y) + t_1;
	else
		tmp = (x + (y + (z + (-0.5 * b)))) - (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, -5e+47], N[Not[LessEqual[t$95$1, 2e+52]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(x + N[(y + N[(z + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $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 -5 \cdot 10^{+47} \lor \neg \left(t_1 \leq 2 \cdot 10^{+52}\right):\\
\;\;\;\;\left(x + y\right) + t_1\\

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

    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. Taylor expanded in z around 0 91.2%

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

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

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

    if -5.00000000000000022e47 < (*.f64 (-.f64 a 1/2) b) < 2e52

    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. 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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

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

Alternative 3: 74.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq -1 \cdot 10^{+173}:\\ \;\;\;\;\left(x + y\right) + t_1\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{+17}:\\ \;\;\;\;t_1 + \left(z - z \cdot \log t\right)\\ \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 (<= (+ x y) -1e+173)
     (+ (+ x y) t_1)
     (if (<= (+ x y) 2e+17) (+ t_1 (- z (* z (log t)))) (+ 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) <= -1e+173) {
		tmp = (x + y) + t_1;
	} else if ((x + y) <= 2e+17) {
		tmp = t_1 + (z - (z * log(t)));
	} 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 ((x + y) <= (-1d+173)) then
        tmp = (x + y) + t_1
    else if ((x + y) <= 2d+17) then
        tmp = t_1 + (z - (z * log(t)))
    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 ((x + y) <= -1e+173) {
		tmp = (x + y) + t_1;
	} else if ((x + y) <= 2e+17) {
		tmp = t_1 + (z - (z * Math.log(t)));
	} else {
		tmp = y + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (a - 0.5)
	tmp = 0
	if (x + y) <= -1e+173:
		tmp = (x + y) + t_1
	elif (x + y) <= 2e+17:
		tmp = t_1 + (z - (z * math.log(t)))
	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 (Float64(x + y) <= -1e+173)
		tmp = Float64(Float64(x + y) + t_1);
	elseif (Float64(x + y) <= 2e+17)
		tmp = Float64(t_1 + Float64(z - Float64(z * log(t))));
	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 ((x + y) <= -1e+173)
		tmp = (x + y) + t_1;
	elseif ((x + y) <= 2e+17)
		tmp = t_1 + (z - (z * log(t)));
	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[N[(x + y), $MachinePrecision], -1e+173], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 2e+17], N[(t$95$1 + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x + y \leq 2 \cdot 10^{+17}:\\
\;\;\;\;t_1 + \left(z - z \cdot \log t\right)\\

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


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

    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. Taylor expanded in z around 0 97.0%

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

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

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

    if -1e173 < (+.f64 x y) < 2e17

    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. Taylor expanded in z around inf 88.7%

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right)} + \left(a - 0.5\right) \cdot b \]
    3. Step-by-step derivation
      1. sub-neg88.7%

        \[\leadsto z \cdot \color{blue}{\left(1 + \left(-\log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
      2. distribute-rgt-in88.8%

        \[\leadsto \color{blue}{\left(1 \cdot z + \left(-\log t\right) \cdot z\right)} + \left(a - 0.5\right) \cdot b \]
      3. *-lft-identity88.8%

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

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

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

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

    if 2e17 < (+.f64 x y)

    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. Taylor expanded in y around inf 45.6%

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

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

Alternative 4: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\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. Final simplification99.9%

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

Alternative 5: 82.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+238} \lor \neg \left(z \leq 1.65 \cdot 10^{+181}\right) \land \left(z \leq 3.3 \cdot 10^{+224} \lor \neg \left(z \leq 3.4 \cdot 10^{+264}\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 -4.8e+238)
         (and (not (<= z 1.65e+181))
              (or (<= z 3.3e+224) (not (<= z 3.4e+264)))))
   (* 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 <= -4.8e+238) || (!(z <= 1.65e+181) && ((z <= 3.3e+224) || !(z <= 3.4e+264)))) {
		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 <= (-4.8d+238)) .or. (.not. (z <= 1.65d+181)) .and. (z <= 3.3d+224) .or. (.not. (z <= 3.4d+264))) 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 <= -4.8e+238) || (!(z <= 1.65e+181) && ((z <= 3.3e+224) || !(z <= 3.4e+264)))) {
		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 <= -4.8e+238) or (not (z <= 1.65e+181) and ((z <= 3.3e+224) or not (z <= 3.4e+264))):
		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 <= -4.8e+238) || (!(z <= 1.65e+181) && ((z <= 3.3e+224) || !(z <= 3.4e+264))))
		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 <= -4.8e+238) || (~((z <= 1.65e+181)) && ((z <= 3.3e+224) || ~((z <= 3.4e+264)))))
		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, -4.8e+238], And[N[Not[LessEqual[z, 1.65e+181]], $MachinePrecision], Or[LessEqual[z, 3.3e+224], N[Not[LessEqual[z, 3.4e+264]], $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 -4.8 \cdot 10^{+238} \lor \neg \left(z \leq 1.65 \cdot 10^{+181}\right) \land \left(z \leq 3.3 \cdot 10^{+224} \lor \neg \left(z \leq 3.4 \cdot 10^{+264}\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 < -4.8e238 or 1.65000000000000008e181 < z < 3.29999999999999996e224 or 3.4000000000000001e264 < z

    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. Taylor expanded in a around 0 99.4%

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

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

    if -4.8e238 < z < 1.65000000000000008e181 or 3.29999999999999996e224 < z < 3.4000000000000001e264

    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. Taylor expanded in z around 0 89.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+238} \lor \neg \left(z \leq 1.65 \cdot 10^{+181}\right) \land \left(z \leq 3.3 \cdot 10^{+224} \lor \neg \left(z \leq 3.4 \cdot 10^{+264}\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: 87.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{-89} \lor \neg \left(b \leq 2.85 \cdot 10^{-40}\right):\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\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 b < -7.4999999999999999e-89 or 2.84999999999999992e-40 < b

    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. Taylor expanded in z around 0 89.2%

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

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

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

    if -7.4999999999999999e-89 < b < 2.84999999999999992e-40

    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. Taylor expanded in a around 0 99.8%

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

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

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

Alternative 7: 84.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+238} \lor \neg \left(z \leq 1.05 \cdot 10^{+148}\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 -1.45e+238) (not (<= z 1.05e+148)))
   (+ 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 <= -1.45e+238) || !(z <= 1.05e+148)) {
		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 <= (-1.45d+238)) .or. (.not. (z <= 1.05d+148))) 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 <= -1.45e+238) || !(z <= 1.05e+148)) {
		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 <= -1.45e+238) or not (z <= 1.05e+148):
		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 <= -1.45e+238) || !(z <= 1.05e+148))
		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 <= -1.45e+238) || ~((z <= 1.05e+148)))
		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, -1.45e+238], N[Not[LessEqual[z, 1.05e+148]], $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 -1.45 \cdot 10^{+238} \lor \neg \left(z \leq 1.05 \cdot 10^{+148}\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 < -1.4500000000000001e238 or 1.04999999999999999e148 < z

    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. Taylor expanded in a around 0 99.5%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. sub-neg83.9%

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

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} + \left(-z \cdot \log t\right)\right) \]
      5. distribute-rgt-neg-in83.9%

        \[\leadsto \left(x + y\right) + \left(z \cdot 1 + \color{blue}{z \cdot \left(-\log t\right)}\right) \]
      6. distribute-lft-in83.9%

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

        \[\leadsto \left(x + y\right) + z \cdot \color{blue}{\left(1 - \log t\right)} \]
      8. associate-+r+83.9%

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

        \[\leadsto x + \color{blue}{\left(z \cdot \left(1 - \log t\right) + y\right)} \]
      10. fma-def84.0%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified84.0%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in y around 0 72.6%

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

    if -1.4500000000000001e238 < z < 1.04999999999999999e148

    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. Taylor expanded in z around 0 90.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+238} \lor \neg \left(z \leq 1.05 \cdot 10^{+148}\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: 84.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.3%

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

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. sub-neg99.3%

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(z \cdot \left(1 - \log t\right) + y\right)} \]
      10. fma-def99.6%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified99.6%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in y around 0 94.1%

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

    if -3.20000000000000017e237 < z < 1.6600000000000002e181

    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. Taylor expanded in z around 0 90.4%

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

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

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

    if 1.6600000000000002e181 < z

    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. Taylor expanded in a around 0 99.5%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. sub-neg79.9%

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

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} + \left(-z \cdot \log t\right)\right) \]
      5. distribute-rgt-neg-in79.9%

        \[\leadsto \left(x + y\right) + \left(z \cdot 1 + \color{blue}{z \cdot \left(-\log t\right)}\right) \]
      6. distribute-lft-in79.9%

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

        \[\leadsto \left(x + y\right) + z \cdot \color{blue}{\left(1 - \log t\right)} \]
      8. associate-+r+79.9%

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

        \[\leadsto x + \color{blue}{\left(z \cdot \left(1 - \log t\right) + y\right)} \]
      10. fma-def79.9%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified79.9%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in x around 0 72.4%

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

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

Alternative 9: 49.9% accurate, 5.4× speedup?

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

\\
\begin{array}{l}
t_1 := x + b \cdot a\\
\mathbf{if}\;x + y \leq -4 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x + y \leq -5 \cdot 10^{+40}:\\
\;\;\;\;x + -0.5 \cdot b\\

\mathbf{elif}\;x + y \leq -2 \cdot 10^{-48}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x y) < -4e114 or -5.00000000000000003e40 < (+.f64 x y) < -1.9999999999999999e-48

    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. Taylor expanded in x around inf 54.0%

      \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
    3. Taylor expanded in a around inf 46.4%

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

        \[\leadsto x + \color{blue}{b \cdot a} \]
    5. Simplified46.4%

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

    if -4e114 < (+.f64 x y) < -5.00000000000000003e40

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

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

      \[\leadsto x + \color{blue}{-0.5 \cdot b} \]

    if -1.9999999999999999e-48 < (+.f64 x y) < 9.9999999999999998e-17

    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. Taylor expanded in a around 0 99.9%

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

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

    if 9.9999999999999998e-17 < (+.f64 x y)

    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. Taylor expanded in a around 0 99.8%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

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

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} + \left(-z \cdot \log t\right)\right) \]
      5. distribute-rgt-neg-in81.2%

        \[\leadsto \left(x + y\right) + \left(z \cdot 1 + \color{blue}{z \cdot \left(-\log t\right)}\right) \]
      6. distribute-lft-in81.2%

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

        \[\leadsto \left(x + y\right) + z \cdot \color{blue}{\left(1 - \log t\right)} \]
      8. associate-+r+81.2%

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

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified81.3%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in z around 0 63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -4 \cdot 10^{+114}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+40}:\\ \;\;\;\;x + -0.5 \cdot b\\ \mathbf{elif}\;x + y \leq -2 \cdot 10^{-48}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq 10^{-16}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 10: 44.0% accurate, 5.4× speedup?

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

\\
\begin{array}{l}
t_1 := x + b \cdot a\\
\mathbf{if}\;x + y \leq -4 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x + y \leq -5 \cdot 10^{+40}:\\
\;\;\;\;x + -0.5 \cdot b\\

\mathbf{elif}\;x + y \leq -2 \cdot 10^{-48}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x y) < -4e114 or -5.00000000000000003e40 < (+.f64 x y) < -1.9999999999999999e-48

    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. Taylor expanded in x around inf 54.0%

      \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
    3. Taylor expanded in a around inf 46.4%

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

        \[\leadsto x + \color{blue}{b \cdot a} \]
    5. Simplified46.4%

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

    if -4e114 < (+.f64 x y) < -5.00000000000000003e40

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

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

      \[\leadsto x + \color{blue}{-0.5 \cdot b} \]

    if -1.9999999999999999e-48 < (+.f64 x y) < 2.0000000000000001e-22

    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. Taylor expanded in a around 0 99.9%

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

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

    if 2.0000000000000001e-22 < (+.f64 x y)

    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. Taylor expanded in y around inf 45.6%

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

      \[\leadsto y + \color{blue}{-0.5 \cdot b} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification48.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -4 \cdot 10^{+114}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+40}:\\ \;\;\;\;x + -0.5 \cdot b\\ \mathbf{elif}\;x + y \leq -2 \cdot 10^{-48}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-22}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + -0.5 \cdot b\\ \end{array} \]

Alternative 11: 48.9% accurate, 5.4× speedup?

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

\\
\begin{array}{l}
t_1 := x + b \cdot a\\
\mathbf{if}\;x + y \leq -4 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x + y \leq -5 \cdot 10^{+40}:\\
\;\;\;\;x + -0.5 \cdot b\\

\mathbf{elif}\;x + y \leq -2 \cdot 10^{-48}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x y) < -4e114 or -5.00000000000000003e40 < (+.f64 x y) < -1.9999999999999999e-48

    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. Taylor expanded in x around inf 54.0%

      \[\leadsto \color{blue}{x} + \left(a - 0.5\right) \cdot b \]
    3. Taylor expanded in a around inf 46.4%

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

        \[\leadsto x + \color{blue}{b \cdot a} \]
    5. Simplified46.4%

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

    if -4e114 < (+.f64 x y) < -5.00000000000000003e40

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

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

      \[\leadsto x + \color{blue}{-0.5 \cdot b} \]

    if -1.9999999999999999e-48 < (+.f64 x y) < 9.9999999999999998e-17

    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. Taylor expanded in a around 0 99.9%

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

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

    if 9.9999999999999998e-17 < (+.f64 x y)

    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. Taylor expanded in y around inf 44.9%

      \[\leadsto \color{blue}{y} + \left(a - 0.5\right) \cdot b \]
    3. Taylor expanded in a around inf 37.9%

      \[\leadsto y + \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. *-commutative49.3%

        \[\leadsto x + \color{blue}{b \cdot a} \]
    5. Simplified37.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -4 \cdot 10^{+114}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{+40}:\\ \;\;\;\;x + -0.5 \cdot b\\ \mathbf{elif}\;x + y \leq -2 \cdot 10^{-48}:\\ \;\;\;\;x + b \cdot a\\ \mathbf{elif}\;x + y \leq 10^{-16}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;y + b \cdot a\\ \end{array} \]

Alternative 12: 54.3% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+181}:\\
\;\;\;\;x + y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -5.0000000000000003e181 or 9.9999999999999998e-17 < (+.f64 x 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. Taylor expanded in a around 0 99.9%

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

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

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

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} + \left(-z \cdot \log t\right)\right) \]
      5. distribute-rgt-neg-in80.8%

        \[\leadsto \left(x + y\right) + \left(z \cdot 1 + \color{blue}{z \cdot \left(-\log t\right)}\right) \]
      6. distribute-lft-in80.9%

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

        \[\leadsto \left(x + y\right) + z \cdot \color{blue}{\left(1 - \log t\right)} \]
      8. associate-+r+80.9%

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

        \[\leadsto x + \color{blue}{\left(z \cdot \left(1 - \log t\right) + y\right)} \]
      10. fma-def80.9%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified80.9%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in z around 0 70.0%

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

    if -5.0000000000000003e181 < (+.f64 x y) < 9.9999999999999998e-17

    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. Taylor expanded in a around 0 99.8%

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

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

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

Alternative 13: 48.6% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+173}:\\
\;\;\;\;x + -0.5 \cdot b\\

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

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


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

    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. Taylor expanded in x around inf 50.8%

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

      \[\leadsto x + \color{blue}{-0.5 \cdot b} \]

    if -1e173 < (+.f64 x y) < 9.9999999999999998e-17

    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. Taylor expanded in a around 0 99.8%

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

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

    if 9.9999999999999998e-17 < (+.f64 x y)

    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. Taylor expanded in a around 0 99.8%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

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

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} + \left(-z \cdot \log t\right)\right) \]
      5. distribute-rgt-neg-in81.2%

        \[\leadsto \left(x + y\right) + \left(z \cdot 1 + \color{blue}{z \cdot \left(-\log t\right)}\right) \]
      6. distribute-lft-in81.2%

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

        \[\leadsto \left(x + y\right) + z \cdot \color{blue}{\left(1 - \log t\right)} \]
      8. associate-+r+81.2%

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

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified81.3%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in z around 0 63.1%

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

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

Alternative 14: 58.0% accurate, 8.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 9.9999999999999996e-82

    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. Taylor expanded in x around inf 58.0%

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

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

        \[\leadsto x + b \cdot \color{blue}{\left(a + \left(-0.5\right)\right)} \]
      3. distribute-lft-in58.1%

        \[\leadsto x + \color{blue}{\left(b \cdot a + b \cdot \left(-0.5\right)\right)} \]
      4. metadata-eval58.1%

        \[\leadsto x + \left(b \cdot a + b \cdot \color{blue}{-0.5}\right) \]
    4. Applied egg-rr58.1%

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

    if 9.9999999999999996e-82 < (+.f64 x y)

    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. Taylor expanded in y around inf 50.5%

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

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

Alternative 15: 46.9% accurate, 10.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{+169}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;x + y \leq 2 \cdot 10^{-22}:\\
\;\;\;\;b \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -1.99999999999999987e169 or 2.0000000000000001e-22 < (+.f64 x 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. Taylor expanded in a around 0 99.9%

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

      \[\leadsto \color{blue}{\left(x + \left(y + z\right)\right) - z \cdot \log t} \]
    4. Step-by-step derivation
      1. sub-neg78.9%

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

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

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

        \[\leadsto \left(x + y\right) + \left(\color{blue}{z \cdot 1} + \left(-z \cdot \log t\right)\right) \]
      5. distribute-rgt-neg-in78.9%

        \[\leadsto \left(x + y\right) + \left(z \cdot 1 + \color{blue}{z \cdot \left(-\log t\right)}\right) \]
      6. distribute-lft-in78.9%

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

        \[\leadsto \left(x + y\right) + z \cdot \color{blue}{\left(1 - \log t\right)} \]
      8. associate-+r+78.9%

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

        \[\leadsto x + \color{blue}{\left(z \cdot \left(1 - \log t\right) + y\right)} \]
      10. fma-def78.9%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    5. Simplified78.9%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(z, 1 - \log t, y\right)} \]
    6. Taylor expanded in z around 0 67.8%

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

    if -1.99999999999999987e169 < (+.f64 x y) < 2.0000000000000001e-22

    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. Taylor expanded in a around 0 99.8%

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    5. Simplified41.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -2 \cdot 10^{+169}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq 2 \cdot 10^{-22}:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 16: 54.4% accurate, 10.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 9.9999999999999998e-17

    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. Taylor expanded in x around inf 60.0%

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

    if 9.9999999999999998e-17 < (+.f64 x y)

    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. Taylor expanded in y around inf 44.9%

      \[\leadsto \color{blue}{y} + \left(a - 0.5\right) \cdot b \]
    3. Taylor expanded in a around inf 37.9%

      \[\leadsto y + \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. *-commutative49.3%

        \[\leadsto x + \color{blue}{b \cdot a} \]
    5. Simplified37.9%

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

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

Alternative 17: 58.0% accurate, 10.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a - 0.5\right)\\ \mathbf{if}\;x + y \leq 10^{-81}:\\ \;\;\;\;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 (<= (+ x y) 1e-81) (+ 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 ((x + y) <= 1e-81) {
		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 ((x + y) <= 1d-81) 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 ((x + y) <= 1e-81) {
		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 (x + y) <= 1e-81:
		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 (Float64(x + y) <= 1e-81)
		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 ((x + y) <= 1e-81)
		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[N[(x + y), $MachinePrecision], 1e-81], 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}\;x + y \leq 10^{-81}:\\
\;\;\;\;x + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < 9.9999999999999996e-82

    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. Taylor expanded in x around inf 58.0%

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

    if 9.9999999999999996e-82 < (+.f64 x y)

    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. Taylor expanded in y around inf 50.5%

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

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

Alternative 18: 78.6% 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.9%

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

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

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

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

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

Alternative 19: 28.1% accurate, 16.1× speedup?

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

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

\mathbf{elif}\;y \leq 3700000:\\
\;\;\;\;b \cdot a\\

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


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

    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. Taylor expanded in a around 0 99.9%

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

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

    if -9.19999999999999959e-275 < y < 3.7e6

    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. Taylor expanded in a around 0 99.9%

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    5. Simplified36.2%

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

    if 3.7e6 < y

    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. Taylor expanded in a around 0 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{-275}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3700000:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 20: 28.7% accurate, 37.6× speedup?

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

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

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


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

    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. Taylor expanded in a around 0 100.0%

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

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

    if -8.39999999999999957e71 < x

    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. Taylor expanded in a around 0 99.8%

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

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

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

Alternative 21: 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. Taylor expanded in a around 0 99.9%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification22.9%

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