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

Percentage Accurate: 99.9% → 99.6%
Time: 13.8s
Alternatives: 21
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a + -0.5, b, x + \left(y + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right)\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (fma
  (+ a -0.5)
  b
  (+ x (+ y (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
	return fma((a + -0.5), b, (x + (y + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t))))));
}
function code(x, y, z, t, a, b)
	return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t))))))
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + 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]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. +-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. fma-def99.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)} \]
  4. Step-by-step derivation
    1. *-commutative99.9%

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\left(\left(1 - \log t\right) \cdot \sqrt{z}\right) \cdot \sqrt{z}}\right)\right) \]
  6. Step-by-step derivation
    1. associate-*l*49.5%

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}}\right)\right) \]
  8. Final simplification99.9%

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

Alternative 2: 99.9% accurate, 0.4× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. +-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. fma-def99.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)} \]
  4. Step-by-step derivation
    1. *-commutative99.9%

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\left(\left(1 - \log t\right) \cdot \sqrt{z}\right) \cdot \sqrt{z}}\right)\right) \]
  6. Step-by-step derivation
    1. associate-*l*49.5%

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\frac{z \cdot \left(1 - {\log t}^{2}\right)}{1 + \log t}}\right)\right) \]
  9. Step-by-step derivation
    1. +-commutative99.9%

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

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

      \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\frac{1 - {\log t}^{2}}{\frac{\log t + 1}{z}}}\right)\right) \]
    4. +-commutative99.9%

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

    \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\frac{1 - {\log t}^{2}}{\frac{1 + \log t}{z}}}\right)\right) \]
  11. Step-by-step derivation
    1. clear-num99.8%

      \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + \color{blue}{\frac{1}{\frac{\frac{1 + \log t}{z}}{1 - {\log t}^{2}}}}\right)\right) \]
    2. inv-pow99.8%

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

      \[\leadsto \mathsf{fma}\left(a + -0.5, b, x + \left(y + {\color{blue}{\left(\frac{1}{\frac{1 - {\log t}^{2}}{\frac{1 + \log t}{z}}}\right)}}^{-1}\right)\right) \]
    4. associate-/r/99.9%

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

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

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

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

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

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

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

Alternative 3: 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-def99.9%

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

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

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

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

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

Alternative 4: 99.9% accurate, 0.5× speedup?

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

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

    \[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \]
  2. Step-by-step derivation
    1. +-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. fma-def99.9%

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

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

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

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

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

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

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

Alternative 5: 90.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 a 1/2) b) < -9.99999999999999944e71 or 1.9999999999999999e74 < (*.f64 (-.f64 a 1/2) b)

    1. Initial program 99.9%

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

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

    if -9.99999999999999944e71 < (*.f64 (-.f64 a 1/2) b) < 1.9999999999999999e74

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

    1. Initial program 99.9%

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(y + z\right) - {1}^{0.3333333333333333} \cdot \left(z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
    5. Step-by-step derivation
      1. pow-base-179.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 99.9%

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

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

    if -1.9999999999999999e-188 < (+.f64 x y)

    1. Initial program 99.8%

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(y + z\right) - {1}^{0.3333333333333333} \cdot \left(z \cdot \log t\right)\right)} + \left(a - 0.5\right) \cdot b \]
    5. Step-by-step derivation
      1. pow-base-173.2%

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

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

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

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

        \[\leadsto \left(y + \color{blue}{\left(z + \left(-\log t \cdot z\right)\right)}\right) + \left(a - 0.5\right) \cdot b \]
      6. distribute-lft-neg-in73.2%

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

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

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

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

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

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

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

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

Alternative 8: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 9: 99.9% accurate, 1.0× speedup?

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

\\
\left(\left(a + -0.5\right) \cdot b + \left(x + \left(y + z\right)\right)\right) - \log t \cdot z
\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-def99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 82.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Step-by-step derivation
      1. *-commutative99.2%

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

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

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

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

    if -1.9499999999999999e285 < z < 3.19999999999999989e91

    1. Initial program 99.9%

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

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

    if 3.19999999999999989e91 < z

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 11: 82.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+91}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\

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


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

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)} \]
    4. Step-by-step derivation
      1. *-commutative99.2%

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

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

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

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

    if -1.9499999999999999e285 < z < 1.7e91

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7e91 < z

    1. Initial program 99.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+285}:\\ \;\;\;\;z \cdot \left(1 - \log t\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+91}:\\ \;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - \log t \cdot z\right)\\ \end{array} \]

Alternative 12: 82.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+285} \lor \neg \left(z \leq 2.3 \cdot 10^{+214}\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 -1.95e+285) (not (<= z 2.3e+214)))
   (* z (- 1.0 (log t)))
   (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.95e+285) || !(z <= 2.3e+214)) {
		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 <= (-1.95d+285)) .or. (.not. (z <= 2.3d+214))) 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 <= -1.95e+285) || !(z <= 2.3e+214)) {
		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 <= -1.95e+285) or not (z <= 2.3e+214):
		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 <= -1.95e+285) || !(z <= 2.3e+214))
		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 <= -1.95e+285) || ~((z <= 2.3e+214)))
		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, -1.95e+285], N[Not[LessEqual[z, 2.3e+214]], $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 -1.95 \cdot 10^{+285} \lor \neg \left(z \leq 2.3 \cdot 10^{+214}\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 < -1.9499999999999999e285 or 2.2999999999999999e214 < 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.7%

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

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

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

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

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

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

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

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

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

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

    if -1.9499999999999999e285 < z < 2.2999999999999999e214

    1. Initial program 99.9%

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

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

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

Alternative 13: 46.5% accurate, 6.0× speedup?

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

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

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

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

\mathbf{elif}\;x + y \leq 5 \cdot 10^{+70}:\\
\;\;\;\;a \cdot b\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in b around 0 62.5%

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

    if -5e50 < (+.f64 x y) < -5.00000000000000034e-190 or 5.0000000000000004e53 < (+.f64 x y) < 5.0000000000000002e70

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot a} \]
    6. Simplified58.8%

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

    if -5.00000000000000034e-190 < (+.f64 x y) < 5.0000000000000004e53

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + y \leq -5 \cdot 10^{+50}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x + y \leq -5 \cdot 10^{-190}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+53}:\\ \;\;\;\;-0.5 \cdot b\\ \mathbf{elif}\;x + y \leq 5 \cdot 10^{+70}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 14: 55.7% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{+62} \lor \neg \left(x + y \leq 5 \cdot 10^{+80}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x y) < -5.00000000000000029e62 or 4.99999999999999961e80 < (+.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-def99.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in b around 0 63.8%

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

    if -5.00000000000000029e62 < (+.f64 x y) < 4.99999999999999961e80

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 53.2% accurate, 8.8× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

    if -5.00000000000000029e62 < (+.f64 x y) < 4.99999999999999961e80

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999961e80 < (+.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--100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in b around 0 67.3%

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

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

Alternative 16: 58.3% accurate, 10.4× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in y around 0 54.8%

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

    if 4.99999999999999961e80 < (+.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--100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in b around 0 67.3%

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

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

Alternative 17: 57.9% accurate, 10.4× speedup?

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in y around 0 53.6%

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

    if 4.0000000000000001e-83 < (+.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-def99.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y + \mathsf{fma}\left(b, a + -0.5, x\right)} \]
    7. Taylor expanded in x around 0 47.5%

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

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

Alternative 18: 78.2% accurate, 12.8× speedup?

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

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

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

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

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

Alternative 19: 29.0% accurate, 16.1× speedup?

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

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

\mathbf{elif}\;x \leq -3.3 \cdot 10^{-75}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.00000000000000012e50

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

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

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

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

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

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

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

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

    if -7.00000000000000012e50 < x < -3.3e-75

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e-75 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{+50}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-75}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 20: 28.7% accurate, 37.6× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

    if -6.5000000000000003e50 < x

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 21.9% accurate, 115.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification24.1%

    \[\leadsto x \]

Developer target: 99.6% accurate, 0.4× speedup?

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

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

Reproduce

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

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

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