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

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

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

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

Alternative 2: 89.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -2.0000000000000002e128 or 4.00000000000000015e154 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e128 < (*.f64 (-.f64 a 1/2) b) < 4.00000000000000015e154

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

Alternative 3: 89.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -2.0000000000000002e128 or 4.00000000000000015e154 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e128 < (*.f64 (-.f64 a 1/2) b) < 4.00000000000000015e154

    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.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-def99.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. Taylor expanded in b around 0 95.4%

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

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

Alternative 4: 84.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

    if 5.0000000000000002e70 < (+.f64 x y)

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 6: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 7: 83.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+262} \lor \neg \left(z \leq -2.8 \cdot 10^{+198}\right) \land \left(z \leq -1.6 \cdot 10^{+160} \lor \neg \left(z \leq 1.2 \cdot 10^{+196}\right)\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0000000000000001e262 or -2.8e198 < z < -1.5999999999999999e160 or 1.2e196 < z

    1. Initial program 99.5%

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

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

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

    if -4.0000000000000001e262 < z < -2.8e198 or -1.5999999999999999e160 < z < 1.2e196

    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. add-cube-cbrt99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+262} \lor \neg \left(z \leq -2.8 \cdot 10^{+198}\right) \land \left(z \leq -1.6 \cdot 10^{+160} \lor \neg \left(z \leq 1.2 \cdot 10^{+196}\right)\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a - 0.5\right) + \left(z + \left(x + y\right)\right)\\ \end{array} \]

Alternative 8: 68.8% accurate, 6.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -6e158 or 4.9999999999999997e111 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \left(z - \color{blue}{\log t \cdot z}\right)\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
      6. *-un-lft-identity40.3%

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \color{blue}{z \cdot \left(1 - \log t\right)}\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
    3. Applied egg-rr40.3%

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

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

    if -6e158 < (*.f64 (-.f64 a 1/2) b) < 4.9999999999999997e111

    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. add-cube-cbrt99.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + z\right)} \]
    8. Step-by-step derivation
      1. associate-+r+63.2%

        \[\leadsto \color{blue}{\left(x + y\right) + z} \]
      2. +-commutative63.2%

        \[\leadsto \color{blue}{z + \left(x + y\right)} \]
    9. Simplified63.2%

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

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

Alternative 9: 39.6% accurate, 8.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + -0.5 \cdot b\\
\mathbf{if}\;y \leq 2.4 \cdot 10^{-245}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+136}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.4e-245 or 6.4999999999999998e136 < y < 3.1999999999999998e160

    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. add-cbrt-cube33.1%

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

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

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

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \left(z - \color{blue}{\log t \cdot z}\right)\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
      6. *-un-lft-identity33.1%

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \color{blue}{z \cdot \left(1 - \log t\right)}\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
    3. Applied egg-rr33.1%

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

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

      \[\leadsto \color{blue}{x + -0.5 \cdot b} \]
    6. Step-by-step derivation
      1. *-commutative39.0%

        \[\leadsto x + \color{blue}{b \cdot -0.5} \]
    7. Simplified39.0%

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

    if 2.4e-245 < y < 7.4999999999999996e96

    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.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-def99.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. Taylor expanded in b around inf 39.1%

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

    if 7.4999999999999996e96 < y < 6.4999999999999998e136 or 3.1999999999999998e160 < y

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. +-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+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-def100.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. Taylor expanded in y around inf 69.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.4 \cdot 10^{-245}:\\ \;\;\;\;x + -0.5 \cdot b\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+96}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+136}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+160}:\\ \;\;\;\;x + -0.5 \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 10: 40.8% accurate, 10.3× speedup?

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

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

\mathbf{elif}\;b \leq -1.06 \cdot 10^{-175}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 8.8 \cdot 10^{+83}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.80000000000000048e158 or 8.79999999999999995e83 < b

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. 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-def100.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. Taylor expanded in b around inf 73.6%

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

    if -5.80000000000000048e158 < b < -1.06000000000000002e-175

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

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

    if -1.06000000000000002e-175 < b < 8.79999999999999995e83

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.8 \cdot 10^{+158}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \mathbf{elif}\;b \leq -1.06 \cdot 10^{-175}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 8.8 \cdot 10^{+83}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a - 0.5\right)\\ \end{array} \]

Alternative 11: 57.7% accurate, 10.4× speedup?

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

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

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


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

    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. add-cbrt-cube26.8%

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

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

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

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \left(z - \color{blue}{\log t \cdot z}\right)\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
      6. *-un-lft-identity26.8%

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \color{blue}{z \cdot \left(1 - \log t\right)}\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
    3. Applied egg-rr26.8%

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

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

    if -5.0000000000000002e-23 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \left(z - \color{blue}{\log t \cdot z}\right)\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
      6. *-un-lft-identity39.7%

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

        \[\leadsto \sqrt[3]{{\left(x + \left(y + \color{blue}{z \cdot \left(1 - \log t\right)}\right)\right)}^{3}} + \left(a - 0.5\right) \cdot b \]
    3. Applied egg-rr39.7%

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

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

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

Alternative 12: 78.8% accurate, 10.5× speedup?

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

\\
b \cdot \left(a - 0.5\right) + \left(z + \left(x + y\right)\right)
\end{array}
Derivation
  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. add-cube-cbrt99.5%

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

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

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

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

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

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

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

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

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

Alternative 13: 59.6% accurate, 12.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+158} \lor \neg \left(b \leq 2.3 \cdot 10^{+117}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.5000000000000001e158 or 2.29999999999999988e117 < b

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. 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-def99.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. Taylor expanded in b around inf 75.3%

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

    if -6.5000000000000001e158 < b < 2.29999999999999988e117

    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. add-cube-cbrt99.4%

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

        \[\leadsto \left(\left(\left(x + y\right) + z\right) - \color{blue}{{\left(\sqrt[3]{z \cdot \log t}\right)}^{3}}\right) + \left(a - 0.5\right) \cdot b \]
    3. Applied egg-rr99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(y + z\right)} \]
    8. Step-by-step derivation
      1. associate-+r+59.9%

        \[\leadsto \color{blue}{\left(x + y\right) + z} \]
      2. +-commutative59.9%

        \[\leadsto \color{blue}{z + \left(x + y\right)} \]
    9. Simplified59.9%

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

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

Alternative 14: 78.0% accurate, 12.8× speedup?

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

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

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

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

Alternative 15: 29.0% accurate, 16.1× speedup?

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

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

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+95}:\\
\;\;\;\;a \cdot b\\

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


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

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

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

    if 1.04999999999999992e-285 < y < 4.59999999999999994e95

    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-def99.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. Taylor expanded in a around inf 23.7%

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

        \[\leadsto \color{blue}{b \cdot a} \]
    6. Simplified23.7%

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

    if 4.59999999999999994e95 < y

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. +-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+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-def100.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. Taylor expanded in y around inf 62.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.05 \cdot 10^{-285}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+95}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 16: 28.4% accurate, 37.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 9 \cdot 10^{+77}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (if (<= y 9e+77) x y))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 9e+77) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= 9d+77) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 9e+77) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= 9e+77:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= 9e+77)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= 9e+77)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 9e+77], x, y]
\begin{array}{l}

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

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


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

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

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

    if 9.00000000000000049e77 < y

    1. Initial program 99.9%

      \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
    2. Step-by-step derivation
      1. +-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+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-def100.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. Taylor expanded in y around inf 56.3%

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

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

Alternative 17: 22.1% 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.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.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-def99.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. Taylor expanded in x around inf 23.2%

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

    \[\leadsto x \]

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

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

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