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

Percentage Accurate: 99.9% → 99.9%
Time: 10.3s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.0% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 a #s(literal 1/2 binary64)) < -5e16 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -5e16 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+112} \lor \neg \left(a - 0.5 \leq 4 \cdot 10^{+37}\right):\\
\;\;\;\;a \cdot b + \left(\left(y + z\right) - t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 a #s(literal 1/2 binary64)) < -9.9999999999999993e111 or 3.99999999999999982e37 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999993e111 < (-.f64 a #s(literal 1/2 binary64)) < 3.99999999999999982e37

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 70.8% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000007e-63 < (+.f64 x y) < 9.99999999999999945e65

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999945e65 < (+.f64 x y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x + y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b + \left(z - t\_1\right)\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000007e-63 < (+.f64 x y) < 5.00000000000000029e62

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000029e62 < (+.f64 x y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 74.2% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000007e-63 < (+.f64 x y) < 5.00000000000000022e92

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000022e92 < (+.f64 x y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{+110} \lor \neg \left(b \leq 2.4 \cdot 10^{+123}\right):\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.45e110 or 2.39999999999999989e123 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e110 < b < 2.39999999999999989e123

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+113} \lor \neg \left(z \leq 3.2 \cdot 10^{+97}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.70000000000000011e113 or 3.20000000000000016e97 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000011e113 < z < 3.20000000000000016e97

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+113} \lor \neg \left(z \leq 3.2 \cdot 10^{+97}\right):\\ \;\;\;\;x + z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 63.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+188} \lor \neg \left(z \leq 3.6 \cdot 10^{+99}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.04999999999999993e188 or 3.6000000000000002e99 < z

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999993e188 < z < 3.6000000000000002e99

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+188} \lor \neg \left(z \leq 3.6 \cdot 10^{+99}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(a - 0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 62.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(x + z\right)} - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b \]
    6. Step-by-step derivation
      1. +-commutative74.2%

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

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

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

    if 6.29999999999999987e93 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 36.2% accurate, 5.0× speedup?

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

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

\mathbf{elif}\;a \leq -1.2 \cdot 10^{-290}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 8.8 \cdot 10^{-141}:\\
\;\;\;\;-0.5 \cdot b\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+80}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.4000000000000001e87 or 3.59999999999999995e80 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 - \log t\right) + \color{blue}{a \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative80.2%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(1 + \frac{a \cdot b}{z}\right) - \log t\right)} \]
    9. Taylor expanded in z around 0 61.3%

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

    if -6.4000000000000001e87 < a < -1.2e-290 or 8.80000000000000037e-141 < a < 3.59999999999999995e80

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e-290 < a < 8.80000000000000037e-141

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot b} \]
    8. Step-by-step derivation
      1. *-commutative30.6%

        \[\leadsto \color{blue}{b \cdot -0.5} \]
    9. Simplified30.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.4 \cdot 10^{+87}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-290}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{-141}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{+80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 47.7% accurate, 6.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+98} \lor \neg \left(a - 0.5 \leq 4 \cdot 10^{+79}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 a #s(literal 1/2 binary64)) < -4.9999999999999998e98 or 3.99999999999999987e79 < (-.f64 a #s(literal 1/2 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 - \log t\right) + \color{blue}{a \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative80.2%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(1 + \frac{a \cdot b}{z}\right) - \log t\right)} \]
    9. Taylor expanded in z around 0 61.3%

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

    if -4.9999999999999998e98 < (-.f64 a #s(literal 1/2 binary64)) < 3.99999999999999987e79

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(x + z\right)} - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b \]
    6. Step-by-step derivation
      1. +-commutative60.2%

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

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

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

      \[\leadsto x + b \cdot \color{blue}{-0.5} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+98} \lor \neg \left(a - 0.5 \leq 4 \cdot 10^{+79}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + -0.5 \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 55.8% accurate, 7.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-21} \lor \neg \left(a \leq 2.2 \cdot 10^{+39}\right):\\
\;\;\;\;x + a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.20000000000000025e-21 or 2.2000000000000001e39 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{b \cdot a} \]
    11. Simplified66.6%

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

    if -4.20000000000000025e-21 < a < 2.2000000000000001e39

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(x + z\right)} - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b \]
    6. Step-by-step derivation
      1. +-commutative56.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.2 \cdot 10^{-21} \lor \neg \left(a \leq 2.2 \cdot 10^{+39}\right):\\ \;\;\;\;x + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + -0.5 \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 36.0% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.85 \cdot 10^{+90} \lor \neg \left(a \leq 3 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.85000000000000017e90 or 2.99999999999999997e81 < a

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \left(1 - \log t\right) + \color{blue}{a \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative80.2%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(1 + \frac{a \cdot b}{z}\right) - \log t\right)} \]
    9. Taylor expanded in z around 0 61.3%

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

    if -3.85000000000000017e90 < a < 2.99999999999999997e81

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.85 \cdot 10^{+90} \lor \neg \left(a \leq 3 \cdot 10^{+81}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 41.4% accurate, 11.5× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e104 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 57.4% accurate, 16.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\color{blue}{\left(x + z\right)} - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b \]
  6. Step-by-step derivation
    1. +-commutative67.8%

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

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

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

Alternative 17: 21.9% accurate, 115.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Developer Target 1: 99.6% 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 2024141 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))

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