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

Percentage Accurate: 99.8% → 99.9%
Time: 9.9s
Alternatives: 15
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 15 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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.9% 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^{+59}:\\ \;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+150}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (- a 0.5))))
   (if (<= t_1 -2e+59)
     (fma b (+ a -0.5) (+ x y))
     (if (<= t_1 1e+150) (+ (* z (- 1.0 (log t))) (+ x y)) (+ (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (a - 0.5);
	double tmp;
	if (t_1 <= -2e+59) {
		tmp = fma(b, (a + -0.5), (x + y));
	} else if (t_1 <= 1e+150) {
		tmp = (z * (1.0 - log(t))) + (x + y);
	} else {
		tmp = (x + y) + t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(a - 0.5))
	tmp = 0.0
	if (t_1 <= -2e+59)
		tmp = fma(b, Float64(a + -0.5), Float64(x + y));
	elseif (t_1 <= 1e+150)
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(x + y));
	else
		tmp = Float64(Float64(x + y) + t_1);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+59], N[(b * N[(a + -0.5), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+150], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+150}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.99999999999999994e59

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a - 0.5, x + y\right)} \]
      4. sub-neg92.4%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{a + \left(-0.5\right)}, x + y\right) \]
      5. metadata-eval92.4%

        \[\leadsto \mathsf{fma}\left(b, a + \color{blue}{-0.5}, x + y\right) \]
    9. Simplified92.4%

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

    if -1.99999999999999994e59 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.99999999999999981e149

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999981e149 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)

    1. Initial program 100.0%

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

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

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

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

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

Alternative 3: 78.9% accurate, 1.0× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in y around 0 78.3%

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

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

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

    if -1.99999999999999997e-118 < (+.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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 87.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+197} \lor \neg \left(z \leq 3.6 \cdot 10^{+189}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -1.15e+197) (not (<= z 3.6e+189)))
   (+ (* z (- 1.0 (log t))) (* a b))
   (fma b (+ a -0.5) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.15e+197) || !(z <= 3.6e+189)) {
		tmp = (z * (1.0 - log(t))) + (a * b);
	} else {
		tmp = fma(b, (a + -0.5), (x + y));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.15e+197) || !(z <= 3.6e+189))
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(a * b));
	else
		tmp = fma(b, Float64(a + -0.5), Float64(x + y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.15e+197], N[Not[LessEqual[z, 3.6e+189]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+197} \lor \neg \left(z \leq 3.6 \cdot 10^{+189}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.15e197 or 3.60000000000000008e189 < z

    1. Initial program 99.6%

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

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

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

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

        \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15e197 < z < 3.60000000000000008e189

    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--100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a - 0.5, x + y\right)} \]
      4. sub-neg87.9%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{a + \left(-0.5\right)}, x + y\right) \]
      5. metadata-eval87.9%

        \[\leadsto \mathsf{fma}\left(b, a + \color{blue}{-0.5}, x + y\right) \]
    9. Simplified87.9%

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

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

Alternative 5: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+121}:\\ \;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(1 - \log t\right) + \left(y + b \cdot \left(a - 0.5\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -6.5e+121)
   (fma b (+ a -0.5) (+ x y))
   (+ (* z (- 1.0 (log t))) (+ y (* b (- a 0.5))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -6.5e+121) {
		tmp = fma(b, (a + -0.5), (x + y));
	} else {
		tmp = (z * (1.0 - log(t))) + (y + (b * (a - 0.5)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -6.5e+121)
		tmp = fma(b, Float64(a + -0.5), Float64(x + y));
	else
		tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(y + Float64(b * Float64(a - 0.5))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.5e+121], N[(b * N[(a + -0.5), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    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-define100.0%

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a - 0.5, x + y\right)} \]
      4. sub-neg94.8%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{a + \left(-0.5\right)}, x + y\right) \]
      5. metadata-eval94.8%

        \[\leadsto \mathsf{fma}\left(b, a + \color{blue}{-0.5}, x + y\right) \]
    9. Simplified94.8%

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

    if -6.50000000000000019e121 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+200} \lor \neg \left(z \leq 1.25 \cdot 10^{+200}\right):\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a + -0.5, x + y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -4.5e+200) (not (<= z 1.25e+200)))
   (* z (- 1.0 (log t)))
   (fma b (+ a -0.5) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -4.5e+200) || !(z <= 1.25e+200)) {
		tmp = z * (1.0 - log(t));
	} else {
		tmp = fma(b, (a + -0.5), (x + y));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -4.5e+200) || !(z <= 1.25e+200))
		tmp = Float64(z * Float64(1.0 - log(t)));
	else
		tmp = fma(b, Float64(a + -0.5), Float64(x + y));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.5e+200], N[Not[LessEqual[z, 1.25e+200]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+200} \lor \neg \left(z \leq 1.25 \cdot 10^{+200}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.49999999999999969e200 or 1.25000000000000005e200 < z

    1. Initial program 99.6%

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

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

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

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

        \[\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.6%

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.7%

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

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

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

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

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

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

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

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

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

    if -4.49999999999999969e200 < z < 1.25000000000000005e200

    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--100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a - 0.5, x + y\right)} \]
      4. sub-neg87.9%

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{a + \left(-0.5\right)}, x + y\right) \]
      5. metadata-eval87.9%

        \[\leadsto \mathsf{fma}\left(b, a + \color{blue}{-0.5}, x + y\right) \]
    9. Simplified87.9%

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

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

Alternative 7: 84.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+200} \lor \neg \left(z \leq 1.12 \cdot 10^{+194}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.19999999999999994e200 or 1.11999999999999994e194 < z

    1. Initial program 99.6%

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

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

        \[\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.6%

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

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

        \[\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.6%

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.7%

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

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

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

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

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

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

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

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

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

    if -4.19999999999999994e200 < z < 1.11999999999999994e194

    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. Add Preprocessing
    3. Taylor expanded in z around 0 87.9%

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

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

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

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

Alternative 8: 99.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 9: 35.3% accurate, 7.7× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.5%

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

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

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

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

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

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

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

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

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

    if -7.9999999999999996e-213 < y < 3.49999999999999989e140

    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. Add Preprocessing
    3. Taylor expanded in b around inf 47.4%

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

    if 3.49999999999999989e140 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 28.7% accurate, 8.8× speedup?

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

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

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+140}:\\
\;\;\;\;a \cdot b\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.5%

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

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

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

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

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

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

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

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

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

    if -4.7e-216 < y < 3.49999999999999989e140

    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. Add Preprocessing
    3. Taylor expanded in a around inf 36.3%

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

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

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

    if 3.49999999999999989e140 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.7 \cdot 10^{-216}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+140}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 64.3% accurate, 9.6× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y \leq 3.3:\\
\;\;\;\;x + t\_1\\

\mathbf{else}:\\
\;\;\;\;y + t\_1\\


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

    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. Add Preprocessing
    3. Taylor expanded in x around inf 62.8%

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

    if 3.2999999999999998 < y

    1. Initial program 100.0%

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

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

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

Alternative 12: 60.9% accurate, 9.6× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in x around inf 61.9%

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

    if 3.8000000000000001e140 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

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

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

Alternative 13: 78.8% accurate, 12.8× speedup?

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

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

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

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

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

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

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

Alternative 14: 27.6% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 280000000:\\
\;\;\;\;x\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.6%

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

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

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

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

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

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

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

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

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

    if 2.8e8 < 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+99.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt99.7%

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

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

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 21.8% accurate, 115.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt99.6%

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

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

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

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

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

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

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

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

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

Developer target: 99.5% accurate, 0.4× speedup?

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

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

Reproduce

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

  :alt
  (+ (+ (+ 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)))