Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C

Percentage Accurate: 97.9% → 99.0%
Time: 15.8s
Alternatives: 19
Speedup: 1.0×

Specification

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

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\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 19 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: 97.9% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}

Alternative 1: 99.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;\left(x \cdot y + \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* t (* z 0.0625))))
   (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY)
     (+ (+ (* x y) (fma a (* b -0.25) c)) t_1)
     (fma y x t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = t * (z * 0.0625);
	double tmp;
	if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
		tmp = ((x * y) + fma(a, (b * -0.25), c)) + t_1;
	} else {
		tmp = fma(y, x, t_1);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = Float64(t * Float64(z * 0.0625))
	tmp = 0.0
	if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf)
		tmp = Float64(Float64(Float64(x * y) + fma(a, Float64(b * -0.25), c)) + t_1);
	else
		tmp = fma(y, x, t_1);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x * y), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(y * x + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;\left(x \cdot y + \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right) + t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef100.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef100.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.9%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.9%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef99.9%

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

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.9%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def100.0%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4))

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-0.0%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+0.0%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def50.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg50.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-150.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative50.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified50.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef0.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef0.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef0.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/0.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+0.0%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/0.0%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef33.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative33.3%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef0.0%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/0.0%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+0.0%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv0.0%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def0.0%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr0.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 50.0%

      \[\leadsto \color{blue}{x \cdot y} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Step-by-step derivation
      1. *-commutative50.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot \left(z \cdot 0.0625\right)\right)} \]
      3. *-commutative83.3%

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot \color{blue}{\left(0.0625 \cdot z\right)}\right) \]
    9. Applied egg-rr83.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot \left(0.0625 \cdot z\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;\left(x \cdot y + \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right) + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot \left(z \cdot 0.0625\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right) \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c)
	return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c)))
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. associate-+l-97.6%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
    2. associate--l+97.6%

      \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
    3. fma-def98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
    4. associate-*l/98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
    5. fma-neg98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
    6. sub-neg98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
    7. distribute-neg-in98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
    8. remove-double-neg98.8%

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

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
    10. distribute-frac-neg98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
    11. associate-/r/98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
    12. fma-def98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
    13. neg-mul-198.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
    14. *-commutative98.8%

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

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
    16. metadata-eval98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
  4. Add Preprocessing
  5. Final simplification98.8%

    \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right) \]
  6. Add Preprocessing

Alternative 3: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;c + t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot \left(z \cdot 0.0625\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
   (if (<= t_1 INFINITY) (+ c t_1) (fma y x (* t (* z 0.0625))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = c + t_1;
	} else {
		tmp = fma(y, x, (t * (z * 0.0625)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(c + t_1);
	else
		tmp = fma(y, x, Float64(t * Float64(z * 0.0625)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot \left(z \cdot 0.0625\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4))

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-0.0%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+0.0%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def50.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg50.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-150.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative50.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval50.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified50.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef0.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef0.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef0.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/0.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+0.0%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/0.0%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef33.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative33.3%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef0.0%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/0.0%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+0.0%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv0.0%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def0.0%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/0.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr0.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 50.0%

      \[\leadsto \color{blue}{x \cdot y} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Step-by-step derivation
      1. *-commutative50.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot \left(z \cdot 0.0625\right)\right)} \]
      3. *-commutative83.3%

        \[\leadsto \mathsf{fma}\left(y, x, t \cdot \color{blue}{\left(0.0625 \cdot z\right)}\right) \]
    9. Applied egg-rr83.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, t \cdot \left(0.0625 \cdot z\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot \left(z \cdot 0.0625\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.3% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(c + \frac{a}{\frac{-4}{b}}\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. sub-neg97.6%

      \[\leadsto \color{blue}{\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(-\frac{a \cdot b}{4}\right)\right)} + c \]
    2. associate-+l+97.6%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\left(-\frac{a \cdot b}{4}\right) + c\right)} \]
    3. fma-def98.4%

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\left(-\frac{a \cdot b}{4}\right) + c\right) \]
    5. distribute-frac-neg98.4%

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(\color{blue}{\frac{-a \cdot b}{4}} + c\right) \]
    6. distribute-rgt-neg-out98.4%

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

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(\color{blue}{\frac{a}{\frac{4}{-b}}} + c\right) \]
    8. neg-mul-198.4%

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(\frac{a}{\frac{4}{\color{blue}{-1 \cdot b}}} + c\right) \]
    9. associate-/r*98.4%

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(\frac{a}{\color{blue}{\frac{\frac{4}{-1}}{b}}} + c\right) \]
    10. metadata-eval98.4%

      \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(\frac{a}{\frac{\color{blue}{-4}}{b}} + c\right) \]
  3. Simplified98.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
  4. Add Preprocessing
  5. Final simplification98.4%

    \[\leadsto \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(c + \frac{a}{\frac{-4}{b}}\right) \]
  6. Add Preprocessing

Alternative 5: 64.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + a \cdot \left(b \cdot -0.25\right)\\ t_2 := z \cdot \left(t \cdot 0.0625\right)\\ t_3 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+41}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-289}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{-119}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\ \;\;\;\;c + t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* a (* b -0.25))))
        (t_2 (* z (* t 0.0625)))
        (t_3 (+ c (* x y))))
   (if (<= (* x y) -7.5e+41)
     t_3
     (if (<= (* x y) 0.0)
       t_1
       (if (<= (* x y) 1.3e-289)
         t_2
         (if (<= (* x y) 1.6e-119)
           t_1
           (if (<= (* x y) 3.2e+147) (+ c t_2) t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (a * (b * -0.25));
	double t_2 = z * (t * 0.0625);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -7.5e+41) {
		tmp = t_3;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 1.3e-289) {
		tmp = t_2;
	} else if ((x * y) <= 1.6e-119) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e+147) {
		tmp = c + t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = c + (a * (b * (-0.25d0)))
    t_2 = z * (t * 0.0625d0)
    t_3 = c + (x * y)
    if ((x * y) <= (-7.5d+41)) then
        tmp = t_3
    else if ((x * y) <= 0.0d0) then
        tmp = t_1
    else if ((x * y) <= 1.3d-289) then
        tmp = t_2
    else if ((x * y) <= 1.6d-119) then
        tmp = t_1
    else if ((x * y) <= 3.2d+147) then
        tmp = c + t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (a * (b * -0.25));
	double t_2 = z * (t * 0.0625);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -7.5e+41) {
		tmp = t_3;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 1.3e-289) {
		tmp = t_2;
	} else if ((x * y) <= 1.6e-119) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e+147) {
		tmp = c + t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (a * (b * -0.25))
	t_2 = z * (t * 0.0625)
	t_3 = c + (x * y)
	tmp = 0
	if (x * y) <= -7.5e+41:
		tmp = t_3
	elif (x * y) <= 0.0:
		tmp = t_1
	elif (x * y) <= 1.3e-289:
		tmp = t_2
	elif (x * y) <= 1.6e-119:
		tmp = t_1
	elif (x * y) <= 3.2e+147:
		tmp = c + t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(a * Float64(b * -0.25)))
	t_2 = Float64(z * Float64(t * 0.0625))
	t_3 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -7.5e+41)
		tmp = t_3;
	elseif (Float64(x * y) <= 0.0)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.3e-289)
		tmp = t_2;
	elseif (Float64(x * y) <= 1.6e-119)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.2e+147)
		tmp = Float64(c + t_2);
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (a * (b * -0.25));
	t_2 = z * (t * 0.0625);
	t_3 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -7.5e+41)
		tmp = t_3;
	elseif ((x * y) <= 0.0)
		tmp = t_1;
	elseif ((x * y) <= 1.3e-289)
		tmp = t_2;
	elseif ((x * y) <= 1.6e-119)
		tmp = t_1;
	elseif ((x * y) <= 3.2e+147)
		tmp = c + t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.5e+41], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.3e-289], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.6e-119], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+147], N[(c + t$95$2), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+41}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-289}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{-119}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\
\;\;\;\;c + t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -7.50000000000000072e41 or 3.19999999999999979e147 < (*.f64 x y)

    1. Initial program 94.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.4%

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

    if -7.50000000000000072e41 < (*.f64 x y) < 0.0 or 1.2999999999999999e-289 < (*.f64 x y) < 1.59999999999999997e-119

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 68.8%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. *-commutative68.8%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + c \]
      2. associate-*r*68.8%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    5. Simplified68.8%

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

    if 0.0 < (*.f64 x y) < 1.2999999999999999e-289

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef100.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef100.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/100.0%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef100.0%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/100.0%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv100.0%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def100.0%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in t around inf 88.1%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*88.1%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} \]
      2. *-commutative88.1%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z \]
      3. *-commutative88.1%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} \]
      4. *-commutative88.1%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} \]
    9. Simplified88.1%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} \]

    if 1.59999999999999997e-119 < (*.f64 x y) < 3.19999999999999979e147

    1. Initial program 97.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 73.8%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*73.8%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
    5. Simplified73.8%

      \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+41}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-289}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{-119}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 44.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot -0.25\right)\\ t_2 := z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{if}\;x \cdot y \leq -4.3 \cdot 10^{+77}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-286}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 1.95 \cdot 10^{-129}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* b (* a -0.25))) (t_2 (* z (* t 0.0625))))
   (if (<= (* x y) -4.3e+77)
     (* x y)
     (if (<= (* x y) 0.0)
       t_1
       (if (<= (* x y) 4.1e-286)
         t_2
         (if (<= (* x y) 1.95e-129)
           t_1
           (if (<= (* x y) 3.2e+147) t_2 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double t_2 = z * (t * 0.0625);
	double tmp;
	if ((x * y) <= -4.3e+77) {
		tmp = x * y;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 4.1e-286) {
		tmp = t_2;
	} else if ((x * y) <= 1.95e-129) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e+147) {
		tmp = t_2;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = b * (a * (-0.25d0))
    t_2 = z * (t * 0.0625d0)
    if ((x * y) <= (-4.3d+77)) then
        tmp = x * y
    else if ((x * y) <= 0.0d0) then
        tmp = t_1
    else if ((x * y) <= 4.1d-286) then
        tmp = t_2
    else if ((x * y) <= 1.95d-129) then
        tmp = t_1
    else if ((x * y) <= 3.2d+147) then
        tmp = t_2
    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 c) {
	double t_1 = b * (a * -0.25);
	double t_2 = z * (t * 0.0625);
	double tmp;
	if ((x * y) <= -4.3e+77) {
		tmp = x * y;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 4.1e-286) {
		tmp = t_2;
	} else if ((x * y) <= 1.95e-129) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e+147) {
		tmp = t_2;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = b * (a * -0.25)
	t_2 = z * (t * 0.0625)
	tmp = 0
	if (x * y) <= -4.3e+77:
		tmp = x * y
	elif (x * y) <= 0.0:
		tmp = t_1
	elif (x * y) <= 4.1e-286:
		tmp = t_2
	elif (x * y) <= 1.95e-129:
		tmp = t_1
	elif (x * y) <= 3.2e+147:
		tmp = t_2
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(b * Float64(a * -0.25))
	t_2 = Float64(z * Float64(t * 0.0625))
	tmp = 0.0
	if (Float64(x * y) <= -4.3e+77)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 0.0)
		tmp = t_1;
	elseif (Float64(x * y) <= 4.1e-286)
		tmp = t_2;
	elseif (Float64(x * y) <= 1.95e-129)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.2e+147)
		tmp = t_2;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = b * (a * -0.25);
	t_2 = z * (t * 0.0625);
	tmp = 0.0;
	if ((x * y) <= -4.3e+77)
		tmp = x * y;
	elseif ((x * y) <= 0.0)
		tmp = t_1;
	elseif ((x * y) <= 4.1e-286)
		tmp = t_2;
	elseif ((x * y) <= 1.95e-129)
		tmp = t_1;
	elseif ((x * y) <= 3.2e+147)
		tmp = t_2;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.3e+77], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.1e-286], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.95e-129], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+147], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -4.3 \cdot 10^{+77}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-286}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 1.95 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.29999999999999991e77 or 3.19999999999999979e147 < (*.f64 x y)

    1. Initial program 94.6%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-94.6%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+94.6%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def97.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg97.8%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-197.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative97.8%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval97.8%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified97.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef94.6%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef94.6%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef94.6%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/94.6%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+94.6%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/94.6%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef96.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative96.8%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef94.6%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/94.6%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+94.6%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv94.6%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def94.6%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num94.6%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv94.6%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval94.6%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/94.6%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr94.6%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 82.3%

      \[\leadsto \color{blue}{x \cdot y} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Taylor expanded in x around inf 72.0%

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

    if -4.29999999999999991e77 < (*.f64 x y) < 0.0 or 4.1e-286 < (*.f64 x y) < 1.95000000000000005e-129

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg99.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef100.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef100.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.9%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.9%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef99.9%

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

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.9%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def99.9%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 78.2%

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

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*78.2%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative78.2%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified78.2%

      \[\leadsto \color{blue}{a \cdot \left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    10. Taylor expanded in a around inf 51.1%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} \]
    11. Step-by-step derivation
      1. *-commutative51.1%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} \]
      2. *-commutative51.1%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot -0.25 \]
      3. associate-*l*51.1%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      4. *-commutative51.1%

        \[\leadsto b \cdot \color{blue}{\left(-0.25 \cdot a\right)} \]
    12. Simplified51.1%

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

    if 0.0 < (*.f64 x y) < 4.1e-286 or 1.95000000000000005e-129 < (*.f64 x y) < 3.19999999999999979e147

    1. Initial program 98.1%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-98.1%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+98.1%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg98.1%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-198.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative98.1%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified98.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef98.1%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef98.1%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef98.1%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/98.1%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+98.1%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/98.1%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative98.1%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef98.1%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/98.1%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+98.1%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv98.1%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def98.1%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in t around inf 54.3%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*54.3%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} \]
      2. *-commutative54.3%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z \]
      3. *-commutative54.3%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} \]
      4. *-commutative54.3%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} \]
    9. Simplified54.3%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.3 \cdot 10^{+77}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-286}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.95 \cdot 10^{-129}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 47.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot -0.25\right)\\ t_2 := z \cdot \left(t \cdot 0.0625\right)\\ t_3 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -2.65 \cdot 10^{+42}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{-287}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-120}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* b (* a -0.25))) (t_2 (* z (* t 0.0625))) (t_3 (+ c (* x y))))
   (if (<= (* x y) -2.65e+42)
     t_3
     (if (<= (* x y) 0.0)
       t_1
       (if (<= (* x y) 1.85e-287)
         t_2
         (if (<= (* x y) 6e-120) t_1 (if (<= (* x y) 3.2e+147) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double t_2 = z * (t * 0.0625);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -2.65e+42) {
		tmp = t_3;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 1.85e-287) {
		tmp = t_2;
	} else if ((x * y) <= 6e-120) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e+147) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = b * (a * (-0.25d0))
    t_2 = z * (t * 0.0625d0)
    t_3 = c + (x * y)
    if ((x * y) <= (-2.65d+42)) then
        tmp = t_3
    else if ((x * y) <= 0.0d0) then
        tmp = t_1
    else if ((x * y) <= 1.85d-287) then
        tmp = t_2
    else if ((x * y) <= 6d-120) then
        tmp = t_1
    else if ((x * y) <= 3.2d+147) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double t_2 = z * (t * 0.0625);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -2.65e+42) {
		tmp = t_3;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 1.85e-287) {
		tmp = t_2;
	} else if ((x * y) <= 6e-120) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e+147) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = b * (a * -0.25)
	t_2 = z * (t * 0.0625)
	t_3 = c + (x * y)
	tmp = 0
	if (x * y) <= -2.65e+42:
		tmp = t_3
	elif (x * y) <= 0.0:
		tmp = t_1
	elif (x * y) <= 1.85e-287:
		tmp = t_2
	elif (x * y) <= 6e-120:
		tmp = t_1
	elif (x * y) <= 3.2e+147:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(b * Float64(a * -0.25))
	t_2 = Float64(z * Float64(t * 0.0625))
	t_3 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -2.65e+42)
		tmp = t_3;
	elseif (Float64(x * y) <= 0.0)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.85e-287)
		tmp = t_2;
	elseif (Float64(x * y) <= 6e-120)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.2e+147)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = b * (a * -0.25);
	t_2 = z * (t * 0.0625);
	t_3 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -2.65e+42)
		tmp = t_3;
	elseif ((x * y) <= 0.0)
		tmp = t_1;
	elseif ((x * y) <= 1.85e-287)
		tmp = t_2;
	elseif ((x * y) <= 6e-120)
		tmp = t_1;
	elseif ((x * y) <= 3.2e+147)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.65e+42], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.85e-287], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6e-120], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+147], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2.65 \cdot 10^{+42}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{-287}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.65000000000000014e42 or 3.19999999999999979e147 < (*.f64 x y)

    1. Initial program 94.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.4%

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

    if -2.65000000000000014e42 < (*.f64 x y) < 0.0 or 1.85000000000000013e-287 < (*.f64 x y) < 6.00000000000000022e-120

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg99.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef100.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef100.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.9%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.9%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef99.9%

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

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.9%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def99.9%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 79.9%

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

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*79.9%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative79.9%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified79.9%

      \[\leadsto \color{blue}{a \cdot \left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    10. Taylor expanded in a around inf 52.5%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} \]
    11. Step-by-step derivation
      1. *-commutative52.5%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} \]
      2. *-commutative52.5%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot -0.25 \]
      3. associate-*l*52.5%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      4. *-commutative52.5%

        \[\leadsto b \cdot \color{blue}{\left(-0.25 \cdot a\right)} \]
    12. Simplified52.5%

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

    if 0.0 < (*.f64 x y) < 1.85000000000000013e-287 or 6.00000000000000022e-120 < (*.f64 x y) < 3.19999999999999979e147

    1. Initial program 98.1%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-98.1%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+98.1%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg98.1%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-198.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative98.1%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval98.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified98.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef98.1%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef98.1%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef98.1%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/98.1%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+98.1%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/98.1%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative98.1%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef98.1%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/98.1%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+98.1%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv98.1%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def98.1%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/98.1%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in t around inf 54.3%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*54.3%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} \]
      2. *-commutative54.3%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z \]
      3. *-commutative54.3%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} \]
      4. *-commutative54.3%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} \]
    9. Simplified54.3%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.65 \cdot 10^{+42}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{-287}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-120}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+147}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 61.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + a \cdot \left(b \cdot -0.25\right)\\ t_2 := z \cdot \left(t \cdot 0.0625\right)\\ t_3 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+40}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-286}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+149}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* a (* b -0.25))))
        (t_2 (* z (* t 0.0625)))
        (t_3 (+ c (* x y))))
   (if (<= (* x y) -9.5e+40)
     t_3
     (if (<= (* x y) 0.0)
       t_1
       (if (<= (* x y) 2.2e-286)
         t_2
         (if (<= (* x y) 8.2e-22) t_1 (if (<= (* x y) 5.4e+149) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (a * (b * -0.25));
	double t_2 = z * (t * 0.0625);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -9.5e+40) {
		tmp = t_3;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 2.2e-286) {
		tmp = t_2;
	} else if ((x * y) <= 8.2e-22) {
		tmp = t_1;
	} else if ((x * y) <= 5.4e+149) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = c + (a * (b * (-0.25d0)))
    t_2 = z * (t * 0.0625d0)
    t_3 = c + (x * y)
    if ((x * y) <= (-9.5d+40)) then
        tmp = t_3
    else if ((x * y) <= 0.0d0) then
        tmp = t_1
    else if ((x * y) <= 2.2d-286) then
        tmp = t_2
    else if ((x * y) <= 8.2d-22) then
        tmp = t_1
    else if ((x * y) <= 5.4d+149) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (a * (b * -0.25));
	double t_2 = z * (t * 0.0625);
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -9.5e+40) {
		tmp = t_3;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 2.2e-286) {
		tmp = t_2;
	} else if ((x * y) <= 8.2e-22) {
		tmp = t_1;
	} else if ((x * y) <= 5.4e+149) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (a * (b * -0.25))
	t_2 = z * (t * 0.0625)
	t_3 = c + (x * y)
	tmp = 0
	if (x * y) <= -9.5e+40:
		tmp = t_3
	elif (x * y) <= 0.0:
		tmp = t_1
	elif (x * y) <= 2.2e-286:
		tmp = t_2
	elif (x * y) <= 8.2e-22:
		tmp = t_1
	elif (x * y) <= 5.4e+149:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(a * Float64(b * -0.25)))
	t_2 = Float64(z * Float64(t * 0.0625))
	t_3 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -9.5e+40)
		tmp = t_3;
	elseif (Float64(x * y) <= 0.0)
		tmp = t_1;
	elseif (Float64(x * y) <= 2.2e-286)
		tmp = t_2;
	elseif (Float64(x * y) <= 8.2e-22)
		tmp = t_1;
	elseif (Float64(x * y) <= 5.4e+149)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (a * (b * -0.25));
	t_2 = z * (t * 0.0625);
	t_3 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -9.5e+40)
		tmp = t_3;
	elseif ((x * y) <= 0.0)
		tmp = t_1;
	elseif ((x * y) <= 2.2e-286)
		tmp = t_2;
	elseif ((x * y) <= 8.2e-22)
		tmp = t_1;
	elseif ((x * y) <= 5.4e+149)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9.5e+40], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-286], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 8.2e-22], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.4e+149], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+40}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-286}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+149}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.5000000000000003e40 or 5.4000000000000002e149 < (*.f64 x y)

    1. Initial program 94.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 77.4%

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

    if -9.5000000000000003e40 < (*.f64 x y) < 0.0 or 2.1999999999999999e-286 < (*.f64 x y) < 8.1999999999999999e-22

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 67.3%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. *-commutative67.3%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + c \]
      2. associate-*r*67.3%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    5. Simplified67.3%

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

    if 0.0 < (*.f64 x y) < 2.1999999999999999e-286 or 8.1999999999999999e-22 < (*.f64 x y) < 5.4000000000000002e149

    1. Initial program 97.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-97.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+97.3%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def97.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg97.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-197.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative97.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval97.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef97.3%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef97.3%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef97.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/97.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+97.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/97.3%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef97.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative97.3%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef97.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/97.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+97.3%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv97.3%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def97.3%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num97.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv97.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval97.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/97.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr97.3%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in t around inf 58.4%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*58.4%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} \]
      2. *-commutative58.4%

        \[\leadsto \color{blue}{\left(t \cdot 0.0625\right)} \cdot z \]
      3. *-commutative58.4%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} \]
      4. *-commutative58.4%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} \]
    9. Simplified58.4%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+40}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-286}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{-22}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+149}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 64.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+236}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+105} \lor \neg \left(a \cdot b \leq -1 \cdot 10^{-14}\right) \land a \cdot b \leq 4 \cdot 10^{+154}:\\ \;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* a b) -2e+236)
   (* b (* a -0.25))
   (if (or (<= (* a b) -2e+105)
           (and (not (<= (* a b) -1e-14)) (<= (* a b) 4e+154)))
     (+ (* x y) (* t (* z 0.0625)))
     (+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a * b) <= -2e+236) {
		tmp = b * (a * -0.25);
	} else if (((a * b) <= -2e+105) || (!((a * b) <= -1e-14) && ((a * b) <= 4e+154))) {
		tmp = (x * y) + (t * (z * 0.0625));
	} else {
		tmp = c + (a * (b * -0.25));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: tmp
    if ((a * b) <= (-2d+236)) then
        tmp = b * (a * (-0.25d0))
    else if (((a * b) <= (-2d+105)) .or. (.not. ((a * b) <= (-1d-14))) .and. ((a * b) <= 4d+154)) then
        tmp = (x * y) + (t * (z * 0.0625d0))
    else
        tmp = c + (a * (b * (-0.25d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a * b) <= -2e+236) {
		tmp = b * (a * -0.25);
	} else if (((a * b) <= -2e+105) || (!((a * b) <= -1e-14) && ((a * b) <= 4e+154))) {
		tmp = (x * y) + (t * (z * 0.0625));
	} else {
		tmp = c + (a * (b * -0.25));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (a * b) <= -2e+236:
		tmp = b * (a * -0.25)
	elif ((a * b) <= -2e+105) or (not ((a * b) <= -1e-14) and ((a * b) <= 4e+154)):
		tmp = (x * y) + (t * (z * 0.0625))
	else:
		tmp = c + (a * (b * -0.25))
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(a * b) <= -2e+236)
		tmp = Float64(b * Float64(a * -0.25));
	elseif ((Float64(a * b) <= -2e+105) || (!(Float64(a * b) <= -1e-14) && (Float64(a * b) <= 4e+154)))
		tmp = Float64(Float64(x * y) + Float64(t * Float64(z * 0.0625)));
	else
		tmp = Float64(c + Float64(a * Float64(b * -0.25)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((a * b) <= -2e+236)
		tmp = b * (a * -0.25);
	elseif (((a * b) <= -2e+105) || (~(((a * b) <= -1e-14)) && ((a * b) <= 4e+154)))
		tmp = (x * y) + (t * (z * 0.0625));
	else
		tmp = c + (a * (b * -0.25));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+236], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+105], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], -1e-14]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 4e+154]]], N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+236}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+105} \lor \neg \left(a \cdot b \leq -1 \cdot 10^{-14}\right) \land a \cdot b \leq 4 \cdot 10^{+154}:\\
\;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -2.00000000000000011e236

    1. Initial program 96.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-96.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+96.3%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def96.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg96.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg96.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-196.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative96.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval96.3%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified96.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef96.3%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef96.3%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef96.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/96.2%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+96.2%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/96.2%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef96.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative96.2%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef96.2%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/96.2%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+96.2%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv96.2%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def96.2%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num96.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv96.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval96.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/96.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr96.3%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 96.3%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Step-by-step derivation
      1. *-commutative96.3%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*96.3%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative96.3%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified96.3%

      \[\leadsto \color{blue}{a \cdot \left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    10. Taylor expanded in a around inf 93.8%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} \]
    11. Step-by-step derivation
      1. *-commutative93.8%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} \]
      2. *-commutative93.8%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot -0.25 \]
      3. associate-*l*93.8%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      4. *-commutative93.8%

        \[\leadsto b \cdot \color{blue}{\left(-0.25 \cdot a\right)} \]
    12. Simplified93.8%

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

    if -2.00000000000000011e236 < (*.f64 a b) < -1.9999999999999999e105 or -9.99999999999999999e-15 < (*.f64 a b) < 4.00000000000000015e154

    1. Initial program 99.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-99.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+99.4%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef99.4%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef99.4%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef99.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.4%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.4%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.4%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def99.4%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num99.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv99.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval99.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/99.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 75.1%

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

    if -1.9999999999999999e105 < (*.f64 a b) < -9.99999999999999999e-15 or 4.00000000000000015e154 < (*.f64 a b)

    1. Initial program 93.2%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 70.4%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. *-commutative70.4%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + c \]
      2. associate-*r*70.4%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    5. Simplified70.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+236}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+105} \lor \neg \left(a \cdot b \leq -1 \cdot 10^{-14}\right) \land a \cdot b \leq 4 \cdot 10^{+154}:\\ \;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+71}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq -20000000:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-14}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+152}:\\ \;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (* x y) (* (* a b) 0.25))))
   (if (<= (* a b) -2e+71)
     t_1
     (if (<= (* a b) -20000000.0)
       (+ c (* z (* t 0.0625)))
       (if (<= (* a b) -1e-14)
         (+ c (* a (* b -0.25)))
         (if (<= (* a b) 2e+152) (+ (* x y) (* t (* z 0.0625))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double tmp;
	if ((a * b) <= -2e+71) {
		tmp = t_1;
	} else if ((a * b) <= -20000000.0) {
		tmp = c + (z * (t * 0.0625));
	} else if ((a * b) <= -1e-14) {
		tmp = c + (a * (b * -0.25));
	} else if ((a * b) <= 2e+152) {
		tmp = (x * y) + (t * (z * 0.0625));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) - ((a * b) * 0.25d0)
    if ((a * b) <= (-2d+71)) then
        tmp = t_1
    else if ((a * b) <= (-20000000.0d0)) then
        tmp = c + (z * (t * 0.0625d0))
    else if ((a * b) <= (-1d-14)) then
        tmp = c + (a * (b * (-0.25d0)))
    else if ((a * b) <= 2d+152) then
        tmp = (x * y) + (t * (z * 0.0625d0))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double tmp;
	if ((a * b) <= -2e+71) {
		tmp = t_1;
	} else if ((a * b) <= -20000000.0) {
		tmp = c + (z * (t * 0.0625));
	} else if ((a * b) <= -1e-14) {
		tmp = c + (a * (b * -0.25));
	} else if ((a * b) <= 2e+152) {
		tmp = (x * y) + (t * (z * 0.0625));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) - ((a * b) * 0.25)
	tmp = 0
	if (a * b) <= -2e+71:
		tmp = t_1
	elif (a * b) <= -20000000.0:
		tmp = c + (z * (t * 0.0625))
	elif (a * b) <= -1e-14:
		tmp = c + (a * (b * -0.25))
	elif (a * b) <= 2e+152:
		tmp = (x * y) + (t * (z * 0.0625))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))
	tmp = 0.0
	if (Float64(a * b) <= -2e+71)
		tmp = t_1;
	elseif (Float64(a * b) <= -20000000.0)
		tmp = Float64(c + Float64(z * Float64(t * 0.0625)));
	elseif (Float64(a * b) <= -1e-14)
		tmp = Float64(c + Float64(a * Float64(b * -0.25)));
	elseif (Float64(a * b) <= 2e+152)
		tmp = Float64(Float64(x * y) + Float64(t * Float64(z * 0.0625)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * y) - ((a * b) * 0.25);
	tmp = 0.0;
	if ((a * b) <= -2e+71)
		tmp = t_1;
	elseif ((a * b) <= -20000000.0)
		tmp = c + (z * (t * 0.0625));
	elseif ((a * b) <= -1e-14)
		tmp = c + (a * (b * -0.25));
	elseif ((a * b) <= 2e+152)
		tmp = (x * y) + (t * (z * 0.0625));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+71], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -20000000.0], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1e-14], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+152], N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -20000000:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-14}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -2.0000000000000001e71 or 2.0000000000000001e152 < (*.f64 a b)

    1. Initial program 95.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 85.8%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in c around 0 78.6%

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

    if -2.0000000000000001e71 < (*.f64 a b) < -2e7

    1. Initial program 92.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 69.9%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*69.9%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
    5. Simplified69.9%

      \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]

    if -2e7 < (*.f64 a b) < -9.99999999999999999e-15

    1. Initial program 99.7%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 68.5%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. *-commutative68.5%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + c \]
      2. associate-*r*68.5%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    5. Simplified68.5%

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

    if -9.99999999999999999e-15 < (*.f64 a b) < 2.0000000000000001e152

    1. Initial program 99.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-99.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+99.3%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef99.3%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef99.3%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef99.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.3%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative100.0%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.3%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.3%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def99.3%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num99.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv99.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval99.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/99.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr99.3%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 75.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+71}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq -20000000:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-14}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+152}:\\ \;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 67.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(z \cdot 0.0625\right)\\ t_2 := x \cdot y + t\_1\\ \mathbf{if}\;x \cdot y \leq -3.15 \cdot 10^{+75}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 5.3 \cdot 10^{-120}:\\ \;\;\;\;t\_1 + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 1.05 \cdot 10^{+24}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* t (* z 0.0625))) (t_2 (+ (* x y) t_1)))
   (if (<= (* x y) -3.15e+75)
     t_2
     (if (<= (* x y) 5.3e-120)
       (+ t_1 (* a (* b -0.25)))
       (if (<= (* x y) 1.05e+24) (+ c (* z (* t 0.0625))) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = t * (z * 0.0625);
	double t_2 = (x * y) + t_1;
	double tmp;
	if ((x * y) <= -3.15e+75) {
		tmp = t_2;
	} else if ((x * y) <= 5.3e-120) {
		tmp = t_1 + (a * (b * -0.25));
	} else if ((x * y) <= 1.05e+24) {
		tmp = c + (z * (t * 0.0625));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    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), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (z * 0.0625d0)
    t_2 = (x * y) + t_1
    if ((x * y) <= (-3.15d+75)) then
        tmp = t_2
    else if ((x * y) <= 5.3d-120) then
        tmp = t_1 + (a * (b * (-0.25d0)))
    else if ((x * y) <= 1.05d+24) then
        tmp = c + (z * (t * 0.0625d0))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = t * (z * 0.0625);
	double t_2 = (x * y) + t_1;
	double tmp;
	if ((x * y) <= -3.15e+75) {
		tmp = t_2;
	} else if ((x * y) <= 5.3e-120) {
		tmp = t_1 + (a * (b * -0.25));
	} else if ((x * y) <= 1.05e+24) {
		tmp = c + (z * (t * 0.0625));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = t * (z * 0.0625)
	t_2 = (x * y) + t_1
	tmp = 0
	if (x * y) <= -3.15e+75:
		tmp = t_2
	elif (x * y) <= 5.3e-120:
		tmp = t_1 + (a * (b * -0.25))
	elif (x * y) <= 1.05e+24:
		tmp = c + (z * (t * 0.0625))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(t * Float64(z * 0.0625))
	t_2 = Float64(Float64(x * y) + t_1)
	tmp = 0.0
	if (Float64(x * y) <= -3.15e+75)
		tmp = t_2;
	elseif (Float64(x * y) <= 5.3e-120)
		tmp = Float64(t_1 + Float64(a * Float64(b * -0.25)));
	elseif (Float64(x * y) <= 1.05e+24)
		tmp = Float64(c + Float64(z * Float64(t * 0.0625)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = t * (z * 0.0625);
	t_2 = (x * y) + t_1;
	tmp = 0.0;
	if ((x * y) <= -3.15e+75)
		tmp = t_2;
	elseif ((x * y) <= 5.3e-120)
		tmp = t_1 + (a * (b * -0.25));
	elseif ((x * y) <= 1.05e+24)
		tmp = c + (z * (t * 0.0625));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.15e+75], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.3e-120], N[(t$95$1 + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.05e+24], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := x \cdot y + t\_1\\
\mathbf{if}\;x \cdot y \leq -3.15 \cdot 10^{+75}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 5.3 \cdot 10^{-120}:\\
\;\;\;\;t\_1 + a \cdot \left(b \cdot -0.25\right)\\

\mathbf{elif}\;x \cdot y \leq 1.05 \cdot 10^{+24}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -3.15000000000000018e75 or 1.0500000000000001e24 < (*.f64 x y)

    1. Initial program 95.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-95.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+95.4%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def98.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg98.2%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-198.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative98.2%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef95.4%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef95.4%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef95.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/95.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+95.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/95.4%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative97.2%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef95.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/95.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+95.4%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv95.4%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def95.4%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr95.4%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 82.2%

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

    if -3.15000000000000018e75 < (*.f64 x y) < 5.29999999999999997e-120

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg99.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef100.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef100.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.9%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.9%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef99.9%

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

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.9%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def99.9%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 79.1%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Step-by-step derivation
      1. *-commutative79.1%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*79.1%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative79.1%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified79.1%

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

    if 5.29999999999999997e-120 < (*.f64 x y) < 1.0500000000000001e24

    1. Initial program 96.8%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.7%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*78.7%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
    5. Simplified78.7%

      \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.15 \cdot 10^{+75}:\\ \;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 5.3 \cdot 10^{-120}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right) + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 1.05 \cdot 10^{+24}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 88.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+43} \lor \neg \left(x \cdot y \leq 8.2 \cdot 10^{-22}\right):\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.60000000000000021e43 or 8.1999999999999999e-22 < (*.f64 x y)

    1. Initial program 95.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 88.1%

      \[\leadsto \color{blue}{\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} + c \]

    if -2.60000000000000021e43 < (*.f64 x y) < 8.1999999999999999e-22

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 97.1%

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+43} \lor \neg \left(x \cdot y \leq 8.2 \cdot 10^{-22}\right):\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 86.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+71} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+189}\right):\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right) + a \cdot \left(b \cdot -0.25\right)\\

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


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

    1. Initial program 93.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-93.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+93.4%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def96.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/96.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg96.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg96.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in96.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg96.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg96.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/96.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def96.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-196.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative96.1%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval96.1%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified96.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef93.4%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef93.4%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef93.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/93.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+93.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/93.3%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef94.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative94.7%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef93.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/93.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+93.3%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv93.3%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def93.3%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num93.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv93.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval93.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/93.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr93.4%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 82.9%

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

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*82.9%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative82.9%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified82.9%

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

    if -1.8e71 < (*.f64 a b) < 2e189

    1. Initial program 99.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 88.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+71} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+189}\right):\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right) + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 87.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+189}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -2.0000000000000001e-13

    1. Initial program 96.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 82.6%

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

    if -2.0000000000000001e-13 < (*.f64 a b) < 2e189

    1. Initial program 99.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 90.2%

      \[\leadsto \color{blue}{\left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} + c \]

    if 2e189 < (*.f64 a b)

    1. Initial program 89.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-89.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+89.3%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def92.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg92.9%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-192.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative92.9%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval92.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified92.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef89.3%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef89.3%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef89.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/89.3%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+89.3%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/89.3%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef89.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative89.3%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef89.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/89.3%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+89.3%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv89.2%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def89.2%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num89.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv89.3%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval89.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/89.3%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr89.3%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 85.7%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*85.7%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative85.7%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified85.7%

      \[\leadsto \color{blue}{a \cdot \left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{-13}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+189}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right) + a \cdot \left(b \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 43.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{-105}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;x \cdot y \leq 5.2 \cdot 10^{+24}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.0999999999999998e75 or 5.1999999999999997e24 < (*.f64 x y)

    1. Initial program 95.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-95.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+95.4%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def98.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg98.2%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-198.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative98.2%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef95.4%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef95.4%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef95.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/95.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+95.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/95.4%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef97.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative97.2%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef95.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/95.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+95.4%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv95.4%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def95.4%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/95.4%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr95.4%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 82.2%

      \[\leadsto \color{blue}{x \cdot y} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Taylor expanded in x around inf 65.4%

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

    if -4.0999999999999998e75 < (*.f64 x y) < 3.59999999999999964e-105

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-100.0%

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

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg99.9%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative100.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval100.0%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef100.0%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef100.0%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef100.0%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/99.9%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/99.9%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef99.9%

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

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/99.9%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+99.9%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv99.9%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def99.9%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/100.0%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in a around inf 79.8%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Step-by-step derivation
      1. *-commutative79.8%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} + t \cdot \left(z \cdot 0.0625\right) \]
      2. associate-*r*79.8%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + t \cdot \left(z \cdot 0.0625\right) \]
      3. *-commutative79.8%

        \[\leadsto a \cdot \color{blue}{\left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    9. Simplified79.8%

      \[\leadsto \color{blue}{a \cdot \left(-0.25 \cdot b\right)} + t \cdot \left(z \cdot 0.0625\right) \]
    10. Taylor expanded in a around inf 47.6%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} \]
    11. Step-by-step derivation
      1. *-commutative47.6%

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25} \]
      2. *-commutative47.6%

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot -0.25 \]
      3. associate-*l*47.6%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      4. *-commutative47.6%

        \[\leadsto b \cdot \color{blue}{\left(-0.25 \cdot a\right)} \]
    12. Simplified47.6%

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

    if 3.59999999999999964e-105 < (*.f64 x y) < 5.1999999999999997e24

    1. Initial program 96.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf 37.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.1 \cdot 10^{+75}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{-105}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 5.2 \cdot 10^{+24}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.9 \cdot 10^{+61} \lor \neg \left(x \cdot y \leq 4.1 \cdot 10^{+24}\right):\\
\;\;\;\;x \cdot y\\

\mathbf{else}:\\
\;\;\;\;c\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -3.89999999999999987e61 or 4.1000000000000001e24 < (*.f64 x y)

    1. Initial program 95.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Step-by-step derivation
      1. associate-+l-95.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
      2. associate--l+95.4%

        \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      3. fma-def98.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
      4. associate-*l/98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
      5. fma-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
      6. sub-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
      7. distribute-neg-in98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
      8. remove-double-neg98.2%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
      10. distribute-frac-neg98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
      11. associate-/r/98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
      12. fma-def98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
      13. neg-mul-198.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
      14. *-commutative98.2%

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

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
      16. metadata-eval98.2%

        \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
    3. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef95.5%

        \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
      2. fma-udef95.5%

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

        \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
      4. fma-udef95.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
      5. associate-/r/95.4%

        \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
      6. associate-+r+95.4%

        \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
      7. associate-*l/95.4%

        \[\leadsto \left(x \cdot y + \color{blue}{\frac{z}{16} \cdot t}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      8. fma-udef97.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} + \left(\frac{a}{\frac{-4}{b}} + c\right) \]
      9. +-commutative97.3%

        \[\leadsto \color{blue}{\left(\frac{a}{\frac{-4}{b}} + c\right) + \mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right)} \]
      10. fma-udef95.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \color{blue}{\left(x \cdot y + \frac{z}{16} \cdot t\right)} \]
      11. associate-*l/95.4%

        \[\leadsto \left(\frac{a}{\frac{-4}{b}} + c\right) + \left(x \cdot y + \color{blue}{\frac{z \cdot t}{16}}\right) \]
      12. associate-+r+95.4%

        \[\leadsto \color{blue}{\left(\left(\frac{a}{\frac{-4}{b}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16}} \]
      13. div-inv95.4%

        \[\leadsto \left(\left(\color{blue}{a \cdot \frac{1}{\frac{-4}{b}}} + c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      14. fma-def95.5%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(a, \frac{1}{\frac{-4}{b}}, c\right)} + x \cdot y\right) + \frac{z \cdot t}{16} \]
      15. clear-num95.5%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{\frac{b}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      16. div-inv95.5%

        \[\leadsto \left(\mathsf{fma}\left(a, \color{blue}{b \cdot \frac{1}{-4}}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      17. metadata-eval95.5%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot \color{blue}{-0.25}, c\right) + x \cdot y\right) + \frac{z \cdot t}{16} \]
      18. associate-*l/95.5%

        \[\leadsto \left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + \color{blue}{\frac{z}{16} \cdot t} \]
    6. Applied egg-rr95.5%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)} \]
    7. Taylor expanded in x around inf 82.4%

      \[\leadsto \color{blue}{x \cdot y} + t \cdot \left(z \cdot 0.0625\right) \]
    8. Taylor expanded in x around inf 64.9%

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

    if -3.89999999999999987e61 < (*.f64 x y) < 4.1000000000000001e24

    1. Initial program 99.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf 21.2%

      \[\leadsto \color{blue}{c} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.9 \cdot 10^{+61} \lor \neg \left(x \cdot y \leq 4.1 \cdot 10^{+24}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 98.0% accurate, 1.0× speedup?

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

\\
x \cdot y + \left(t \cdot \left(z \cdot 0.0625\right) - \left(\frac{a}{\frac{4}{b}} - c\right)\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. associate-+l-97.6%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
    2. associate--l+97.6%

      \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
    3. fma-def98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
    4. associate-*l/98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\frac{z}{16} \cdot t} - \left(\frac{a \cdot b}{4} - c\right)\right) \]
    5. fma-neg98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(\frac{z}{16}, t, -\left(\frac{a \cdot b}{4} - c\right)\right)}\right) \]
    6. sub-neg98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, -\color{blue}{\left(\frac{a \cdot b}{4} + \left(-c\right)\right)}\right)\right) \]
    7. distribute-neg-in98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\left(-\frac{a \cdot b}{4}\right) + \left(-\left(-c\right)\right)}\right)\right) \]
    8. remove-double-neg98.8%

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

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \left(-\color{blue}{\frac{a}{\frac{4}{b}}}\right) + c\right)\right) \]
    10. distribute-frac-neg98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{\frac{4}{b}}} + c\right)\right) \]
    11. associate-/r/98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\frac{-a}{4} \cdot b} + c\right)\right) \]
    12. fma-def98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \color{blue}{\mathsf{fma}\left(\frac{-a}{4}, b, c\right)}\right)\right) \]
    13. neg-mul-198.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{\color{blue}{-1 \cdot a}}{4}, b, c\right)\right)\right) \]
    14. *-commutative98.8%

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

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\color{blue}{\frac{a}{\frac{4}{-1}}}, b, c\right)\right)\right) \]
    16. metadata-eval98.8%

      \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{\color{blue}{-4}}, b, c\right)\right)\right) \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-udef97.6%

      \[\leadsto \color{blue}{x \cdot y + \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)} \]
    2. fma-udef97.6%

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

      \[\leadsto x \cdot y + \left(\color{blue}{\frac{z \cdot t}{16}} + \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right) \]
    4. fma-udef97.6%

      \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \color{blue}{\left(\frac{a}{-4} \cdot b + c\right)}\right) \]
    5. associate-/r/97.6%

      \[\leadsto x \cdot y + \left(\frac{z \cdot t}{16} + \left(\color{blue}{\frac{a}{\frac{-4}{b}}} + c\right)\right) \]
    6. associate-+r+97.6%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{a}{\frac{-4}{b}} + c\right)} \]
    7. frac-2neg97.6%

      \[\leadsto \left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\color{blue}{\frac{-a}{-\frac{-4}{b}}} + c\right) \]
    8. distribute-neg-frac97.6%

      \[\leadsto \left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{-a}{\color{blue}{\frac{--4}{b}}} + c\right) \]
    9. metadata-eval97.6%

      \[\leadsto \left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\frac{-a}{\frac{\color{blue}{4}}{b}} + c\right) \]
    10. distribute-frac-neg97.6%

      \[\leadsto \left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\color{blue}{\left(-\frac{a}{\frac{4}{b}}\right)} + c\right) \]
    11. associate-/l*97.6%

      \[\leadsto \left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(\left(-\color{blue}{\frac{a \cdot b}{4}}\right) + c\right) \]
    12. associate-+l+97.6%

      \[\leadsto \color{blue}{\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(-\frac{a \cdot b}{4}\right)\right) + c} \]
    13. sub-neg97.6%

      \[\leadsto \color{blue}{\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)} + c \]
    14. associate-+l-97.6%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
    15. associate--l+97.6%

      \[\leadsto \color{blue}{x \cdot y + \left(\frac{z \cdot t}{16} - \left(\frac{a \cdot b}{4} - c\right)\right)} \]
  6. Applied egg-rr97.6%

    \[\leadsto \color{blue}{x \cdot y + \left(t \cdot \left(z \cdot 0.0625\right) - \left(\frac{a}{\frac{4}{b}} - c\right)\right)} \]
  7. Final simplification97.6%

    \[\leadsto x \cdot y + \left(t \cdot \left(z \cdot 0.0625\right) - \left(\frac{a}{\frac{4}{b}} - c\right)\right) \]
  8. Add Preprocessing

Alternative 18: 97.9% accurate, 1.0× speedup?

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

\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Add Preprocessing
  3. Final simplification97.6%

    \[\leadsto c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) \]
  4. Add Preprocessing

Alternative 19: 22.9% accurate, 17.0× speedup?

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

\\
c
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Add Preprocessing
  3. Taylor expanded in c around inf 15.9%

    \[\leadsto \color{blue}{c} \]
  4. Final simplification15.9%

    \[\leadsto c \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2024040 
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, C"
  :precision binary64
  (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))