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

Percentage Accurate: 97.7% → 98.8%
Time: 9.5s
Alternatives: 16
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 16 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.7% 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: 98.8% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c + 0.0625 \cdot \left(z \cdot t\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 \]

    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. +-commutative0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(b, -0.25 \cdot a, \mathsf{fma}\left(z, \frac{t}{16}, c\right)\right)\right)} \]
    4. Taylor expanded in b around 0 66.7%

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

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

Alternative 2: 98.8% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(b, -0.25 \cdot a, \mathsf{fma}\left(z, \frac{t}{16}, 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. +-commutative97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(b, -0.25 \cdot a, \mathsf{fma}\left(z, \frac{t}{16}, c\right)\right)\right) \]

Alternative 3: 99.0% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\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. +-commutative97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, y, \frac{z}{\frac{16}{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(z / Float64(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[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{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. 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. sub-neg97.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 44.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := -0.25 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;b \cdot a \leq -5.8 \cdot 10^{+148}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq -1.25 \cdot 10^{-59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -1.45 \cdot 10^{-152}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq -4 \cdot 10^{-218}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -1.65 \cdot 10^{-226}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq -6.8 \cdot 10^{-273}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-323}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq 2.25 \cdot 10^{-94}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 1.62 \cdot 10^{+112}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))) (t_2 (* -0.25 (* b a))))
   (if (<= (* b a) -5.8e+148)
     t_2
     (if (<= (* b a) -1.25e-59)
       t_1
       (if (<= (* b a) -1.45e-152)
         c
         (if (<= (* b a) -4e-218)
           (* x y)
           (if (<= (* b a) -1.65e-226)
             c
             (if (<= (* b a) -6.8e-273)
               t_1
               (if (<= (* b a) -1.05e-278)
                 (* x y)
                 (if (<= (* b a) -5e-323)
                   c
                   (if (<= (* b a) 2.25e-94)
                     (* x y)
                     (if (<= (* b a) 1.62e+112) c t_2))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double t_2 = -0.25 * (b * a);
	double tmp;
	if ((b * a) <= -5.8e+148) {
		tmp = t_2;
	} else if ((b * a) <= -1.25e-59) {
		tmp = t_1;
	} else if ((b * a) <= -1.45e-152) {
		tmp = c;
	} else if ((b * a) <= -4e-218) {
		tmp = x * y;
	} else if ((b * a) <= -1.65e-226) {
		tmp = c;
	} else if ((b * a) <= -6.8e-273) {
		tmp = t_1;
	} else if ((b * a) <= -1.05e-278) {
		tmp = x * y;
	} else if ((b * a) <= -5e-323) {
		tmp = c;
	} else if ((b * a) <= 2.25e-94) {
		tmp = x * y;
	} else if ((b * a) <= 1.62e+112) {
		tmp = c;
	} 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 = 0.0625d0 * (z * t)
    t_2 = (-0.25d0) * (b * a)
    if ((b * a) <= (-5.8d+148)) then
        tmp = t_2
    else if ((b * a) <= (-1.25d-59)) then
        tmp = t_1
    else if ((b * a) <= (-1.45d-152)) then
        tmp = c
    else if ((b * a) <= (-4d-218)) then
        tmp = x * y
    else if ((b * a) <= (-1.65d-226)) then
        tmp = c
    else if ((b * a) <= (-6.8d-273)) then
        tmp = t_1
    else if ((b * a) <= (-1.05d-278)) then
        tmp = x * y
    else if ((b * a) <= (-5d-323)) then
        tmp = c
    else if ((b * a) <= 2.25d-94) then
        tmp = x * y
    else if ((b * a) <= 1.62d+112) then
        tmp = c
    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 = 0.0625 * (z * t);
	double t_2 = -0.25 * (b * a);
	double tmp;
	if ((b * a) <= -5.8e+148) {
		tmp = t_2;
	} else if ((b * a) <= -1.25e-59) {
		tmp = t_1;
	} else if ((b * a) <= -1.45e-152) {
		tmp = c;
	} else if ((b * a) <= -4e-218) {
		tmp = x * y;
	} else if ((b * a) <= -1.65e-226) {
		tmp = c;
	} else if ((b * a) <= -6.8e-273) {
		tmp = t_1;
	} else if ((b * a) <= -1.05e-278) {
		tmp = x * y;
	} else if ((b * a) <= -5e-323) {
		tmp = c;
	} else if ((b * a) <= 2.25e-94) {
		tmp = x * y;
	} else if ((b * a) <= 1.62e+112) {
		tmp = c;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	t_2 = -0.25 * (b * a)
	tmp = 0
	if (b * a) <= -5.8e+148:
		tmp = t_2
	elif (b * a) <= -1.25e-59:
		tmp = t_1
	elif (b * a) <= -1.45e-152:
		tmp = c
	elif (b * a) <= -4e-218:
		tmp = x * y
	elif (b * a) <= -1.65e-226:
		tmp = c
	elif (b * a) <= -6.8e-273:
		tmp = t_1
	elif (b * a) <= -1.05e-278:
		tmp = x * y
	elif (b * a) <= -5e-323:
		tmp = c
	elif (b * a) <= 2.25e-94:
		tmp = x * y
	elif (b * a) <= 1.62e+112:
		tmp = c
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	t_2 = Float64(-0.25 * Float64(b * a))
	tmp = 0.0
	if (Float64(b * a) <= -5.8e+148)
		tmp = t_2;
	elseif (Float64(b * a) <= -1.25e-59)
		tmp = t_1;
	elseif (Float64(b * a) <= -1.45e-152)
		tmp = c;
	elseif (Float64(b * a) <= -4e-218)
		tmp = Float64(x * y);
	elseif (Float64(b * a) <= -1.65e-226)
		tmp = c;
	elseif (Float64(b * a) <= -6.8e-273)
		tmp = t_1;
	elseif (Float64(b * a) <= -1.05e-278)
		tmp = Float64(x * y);
	elseif (Float64(b * a) <= -5e-323)
		tmp = c;
	elseif (Float64(b * a) <= 2.25e-94)
		tmp = Float64(x * y);
	elseif (Float64(b * a) <= 1.62e+112)
		tmp = c;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (z * t);
	t_2 = -0.25 * (b * a);
	tmp = 0.0;
	if ((b * a) <= -5.8e+148)
		tmp = t_2;
	elseif ((b * a) <= -1.25e-59)
		tmp = t_1;
	elseif ((b * a) <= -1.45e-152)
		tmp = c;
	elseif ((b * a) <= -4e-218)
		tmp = x * y;
	elseif ((b * a) <= -1.65e-226)
		tmp = c;
	elseif ((b * a) <= -6.8e-273)
		tmp = t_1;
	elseif ((b * a) <= -1.05e-278)
		tmp = x * y;
	elseif ((b * a) <= -5e-323)
		tmp = c;
	elseif ((b * a) <= 2.25e-94)
		tmp = x * y;
	elseif ((b * a) <= 1.62e+112)
		tmp = c;
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5.8e+148], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -1.25e-59], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -1.45e-152], c, If[LessEqual[N[(b * a), $MachinePrecision], -4e-218], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -1.65e-226], c, If[LessEqual[N[(b * a), $MachinePrecision], -6.8e-273], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -1.05e-278], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -5e-323], c, If[LessEqual[N[(b * a), $MachinePrecision], 2.25e-94], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 1.62e+112], c, t$95$2]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot a \leq -1.25 \cdot 10^{-59}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -1.45 \cdot 10^{-152}:\\
\;\;\;\;c\\

\mathbf{elif}\;b \cdot a \leq -4 \cdot 10^{-218}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \cdot a \leq -1.65 \cdot 10^{-226}:\\
\;\;\;\;c\\

\mathbf{elif}\;b \cdot a \leq -6.8 \cdot 10^{-273}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-323}:\\
\;\;\;\;c\\

\mathbf{elif}\;b \cdot a \leq 2.25 \cdot 10^{-94}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \cdot a \leq 1.62 \cdot 10^{+112}:\\
\;\;\;\;c\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -5.7999999999999999e148 or 1.61999999999999994e112 < (*.f64 a b)

    1. Initial program 93.3%

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

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

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

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

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

    if -5.7999999999999999e148 < (*.f64 a b) < -1.25e-59 or -1.65e-226 < (*.f64 a b) < -6.79999999999999982e-273

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    3. Taylor expanded in t around inf 49.9%

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

    if -1.25e-59 < (*.f64 a b) < -1.4500000000000001e-152 or -4.0000000000000001e-218 < (*.f64 a b) < -1.65e-226 or -1.05000000000000007e-278 < (*.f64 a b) < -4.94066e-323 or 2.2500000000000001e-94 < (*.f64 a b) < 1.61999999999999994e112

    1. Initial program 100.0%

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

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

    if -1.4500000000000001e-152 < (*.f64 a b) < -4.0000000000000001e-218 or -6.79999999999999982e-273 < (*.f64 a b) < -1.05000000000000007e-278 or -4.94066e-323 < (*.f64 a b) < 2.2500000000000001e-94

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -5.8 \cdot 10^{+148}:\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;b \cdot a \leq -1.25 \cdot 10^{-59}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq -1.45 \cdot 10^{-152}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq -4 \cdot 10^{-218}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -1.65 \cdot 10^{-226}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq -6.8 \cdot 10^{-273}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-323}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq 2.25 \cdot 10^{-94}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 1.62 \cdot 10^{+112}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \end{array} \]

Alternative 6: 66.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{if}\;b \cdot a \leq -7 \cdot 10^{+148}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \cdot a \leq -1.72 \cdot 10^{-161}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq -3.9 \cdot 10^{-218}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -2.5 \cdot 10^{-303}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq 2.8 \cdot 10^{-94}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq 1.48 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y)))
        (t_2 (+ c (* 0.0625 (* z t))))
        (t_3 (- (* x y) (* (* b a) 0.25))))
   (if (<= (* b a) -7e+148)
     t_3
     (if (<= (* b a) -1.72e-161)
       t_2
       (if (<= (* b a) -3.9e-218)
         t_1
         (if (<= (* b a) -2.5e-303)
           t_2
           (if (<= (* b a) 2.8e-94)
             t_1
             (if (<= (* b a) 1.48e-5)
               t_2
               (if (<= (* b a) 4e+109) t_1 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = c + (0.0625 * (z * t));
	double t_3 = (x * y) - ((b * a) * 0.25);
	double tmp;
	if ((b * a) <= -7e+148) {
		tmp = t_3;
	} else if ((b * a) <= -1.72e-161) {
		tmp = t_2;
	} else if ((b * a) <= -3.9e-218) {
		tmp = t_1;
	} else if ((b * a) <= -2.5e-303) {
		tmp = t_2;
	} else if ((b * a) <= 2.8e-94) {
		tmp = t_1;
	} else if ((b * a) <= 1.48e-5) {
		tmp = t_2;
	} else if ((b * a) <= 4e+109) {
		tmp = t_1;
	} 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 + (x * y)
    t_2 = c + (0.0625d0 * (z * t))
    t_3 = (x * y) - ((b * a) * 0.25d0)
    if ((b * a) <= (-7d+148)) then
        tmp = t_3
    else if ((b * a) <= (-1.72d-161)) then
        tmp = t_2
    else if ((b * a) <= (-3.9d-218)) then
        tmp = t_1
    else if ((b * a) <= (-2.5d-303)) then
        tmp = t_2
    else if ((b * a) <= 2.8d-94) then
        tmp = t_1
    else if ((b * a) <= 1.48d-5) then
        tmp = t_2
    else if ((b * a) <= 4d+109) then
        tmp = t_1
    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 + (x * y);
	double t_2 = c + (0.0625 * (z * t));
	double t_3 = (x * y) - ((b * a) * 0.25);
	double tmp;
	if ((b * a) <= -7e+148) {
		tmp = t_3;
	} else if ((b * a) <= -1.72e-161) {
		tmp = t_2;
	} else if ((b * a) <= -3.9e-218) {
		tmp = t_1;
	} else if ((b * a) <= -2.5e-303) {
		tmp = t_2;
	} else if ((b * a) <= 2.8e-94) {
		tmp = t_1;
	} else if ((b * a) <= 1.48e-5) {
		tmp = t_2;
	} else if ((b * a) <= 4e+109) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = c + (0.0625 * (z * t))
	t_3 = (x * y) - ((b * a) * 0.25)
	tmp = 0
	if (b * a) <= -7e+148:
		tmp = t_3
	elif (b * a) <= -1.72e-161:
		tmp = t_2
	elif (b * a) <= -3.9e-218:
		tmp = t_1
	elif (b * a) <= -2.5e-303:
		tmp = t_2
	elif (b * a) <= 2.8e-94:
		tmp = t_1
	elif (b * a) <= 1.48e-5:
		tmp = t_2
	elif (b * a) <= 4e+109:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(c + Float64(0.0625 * Float64(z * t)))
	t_3 = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25))
	tmp = 0.0
	if (Float64(b * a) <= -7e+148)
		tmp = t_3;
	elseif (Float64(b * a) <= -1.72e-161)
		tmp = t_2;
	elseif (Float64(b * a) <= -3.9e-218)
		tmp = t_1;
	elseif (Float64(b * a) <= -2.5e-303)
		tmp = t_2;
	elseif (Float64(b * a) <= 2.8e-94)
		tmp = t_1;
	elseif (Float64(b * a) <= 1.48e-5)
		tmp = t_2;
	elseif (Float64(b * a) <= 4e+109)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = c + (0.0625 * (z * t));
	t_3 = (x * y) - ((b * a) * 0.25);
	tmp = 0.0;
	if ((b * a) <= -7e+148)
		tmp = t_3;
	elseif ((b * a) <= -1.72e-161)
		tmp = t_2;
	elseif ((b * a) <= -3.9e-218)
		tmp = t_1;
	elseif ((b * a) <= -2.5e-303)
		tmp = t_2;
	elseif ((b * a) <= 2.8e-94)
		tmp = t_1;
	elseif ((b * a) <= 1.48e-5)
		tmp = t_2;
	elseif ((b * a) <= 4e+109)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -7e+148], t$95$3, If[LessEqual[N[(b * a), $MachinePrecision], -1.72e-161], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -3.9e-218], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -2.5e-303], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 2.8e-94], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 1.48e-5], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 4e+109], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot a \leq -1.72 \cdot 10^{-161}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq -3.9 \cdot 10^{-218}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -2.5 \cdot 10^{-303}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 2.8 \cdot 10^{-94}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 1.48 \cdot 10^{-5}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+109}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -6.9999999999999998e148 or 3.99999999999999993e109 < (*.f64 a b)

    1. Initial program 93.3%

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

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

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

    if -6.9999999999999998e148 < (*.f64 a b) < -1.71999999999999999e-161 or -3.9e-218 < (*.f64 a b) < -2.4999999999999999e-303 or 2.7999999999999998e-94 < (*.f64 a b) < 1.4800000000000001e-5

    1. Initial program 100.0%

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

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

    if -1.71999999999999999e-161 < (*.f64 a b) < -3.9e-218 or -2.4999999999999999e-303 < (*.f64 a b) < 2.7999999999999998e-94 or 1.4800000000000001e-5 < (*.f64 a b) < 3.99999999999999993e109

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot x} + c \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -7 \cdot 10^{+148}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{elif}\;b \cdot a \leq -1.72 \cdot 10^{-161}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq -3.9 \cdot 10^{-218}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -2.5 \cdot 10^{-303}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 2.8 \cdot 10^{-94}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 1.48 \cdot 10^{-5}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+109}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 7: 66.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b \cdot a\right) \cdot 0.25\\ t_2 := c + x \cdot y\\ t_3 := 0.0625 \cdot \left(z \cdot t\right)\\ t_4 := c + t_3\\ \mathbf{if}\;b \cdot a \leq -2.8 \cdot 10^{+119}:\\ \;\;\;\;t_3 - t_1\\ \mathbf{elif}\;b \cdot a \leq -9.2 \cdot 10^{-141}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \cdot a \leq -3.9 \cdot 10^{-218}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq -7 \cdot 10^{-303}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \cdot a \leq 2.9 \cdot 10^{-94}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq 3.3 \cdot 10^{-6}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \cdot a \leq 3.3 \cdot 10^{+112}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* b a) 0.25))
        (t_2 (+ c (* x y)))
        (t_3 (* 0.0625 (* z t)))
        (t_4 (+ c t_3)))
   (if (<= (* b a) -2.8e+119)
     (- t_3 t_1)
     (if (<= (* b a) -9.2e-141)
       t_4
       (if (<= (* b a) -3.9e-218)
         t_2
         (if (<= (* b a) -7e-303)
           t_4
           (if (<= (* b a) 2.9e-94)
             t_2
             (if (<= (* b a) 3.3e-6)
               t_4
               (if (<= (* b a) 3.3e+112) t_2 (- (* x y) t_1))))))))))
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 = c + (x * y);
	double t_3 = 0.0625 * (z * t);
	double t_4 = c + t_3;
	double tmp;
	if ((b * a) <= -2.8e+119) {
		tmp = t_3 - t_1;
	} else if ((b * a) <= -9.2e-141) {
		tmp = t_4;
	} else if ((b * a) <= -3.9e-218) {
		tmp = t_2;
	} else if ((b * a) <= -7e-303) {
		tmp = t_4;
	} else if ((b * a) <= 2.9e-94) {
		tmp = t_2;
	} else if ((b * a) <= 3.3e-6) {
		tmp = t_4;
	} else if ((b * a) <= 3.3e+112) {
		tmp = t_2;
	} else {
		tmp = (x * y) - 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) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = (b * a) * 0.25d0
    t_2 = c + (x * y)
    t_3 = 0.0625d0 * (z * t)
    t_4 = c + t_3
    if ((b * a) <= (-2.8d+119)) then
        tmp = t_3 - t_1
    else if ((b * a) <= (-9.2d-141)) then
        tmp = t_4
    else if ((b * a) <= (-3.9d-218)) then
        tmp = t_2
    else if ((b * a) <= (-7d-303)) then
        tmp = t_4
    else if ((b * a) <= 2.9d-94) then
        tmp = t_2
    else if ((b * a) <= 3.3d-6) then
        tmp = t_4
    else if ((b * a) <= 3.3d+112) then
        tmp = t_2
    else
        tmp = (x * y) - t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (b * a) * 0.25;
	double t_2 = c + (x * y);
	double t_3 = 0.0625 * (z * t);
	double t_4 = c + t_3;
	double tmp;
	if ((b * a) <= -2.8e+119) {
		tmp = t_3 - t_1;
	} else if ((b * a) <= -9.2e-141) {
		tmp = t_4;
	} else if ((b * a) <= -3.9e-218) {
		tmp = t_2;
	} else if ((b * a) <= -7e-303) {
		tmp = t_4;
	} else if ((b * a) <= 2.9e-94) {
		tmp = t_2;
	} else if ((b * a) <= 3.3e-6) {
		tmp = t_4;
	} else if ((b * a) <= 3.3e+112) {
		tmp = t_2;
	} else {
		tmp = (x * y) - t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (b * a) * 0.25
	t_2 = c + (x * y)
	t_3 = 0.0625 * (z * t)
	t_4 = c + t_3
	tmp = 0
	if (b * a) <= -2.8e+119:
		tmp = t_3 - t_1
	elif (b * a) <= -9.2e-141:
		tmp = t_4
	elif (b * a) <= -3.9e-218:
		tmp = t_2
	elif (b * a) <= -7e-303:
		tmp = t_4
	elif (b * a) <= 2.9e-94:
		tmp = t_2
	elif (b * a) <= 3.3e-6:
		tmp = t_4
	elif (b * a) <= 3.3e+112:
		tmp = t_2
	else:
		tmp = (x * y) - t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(b * a) * 0.25)
	t_2 = Float64(c + Float64(x * y))
	t_3 = Float64(0.0625 * Float64(z * t))
	t_4 = Float64(c + t_3)
	tmp = 0.0
	if (Float64(b * a) <= -2.8e+119)
		tmp = Float64(t_3 - t_1);
	elseif (Float64(b * a) <= -9.2e-141)
		tmp = t_4;
	elseif (Float64(b * a) <= -3.9e-218)
		tmp = t_2;
	elseif (Float64(b * a) <= -7e-303)
		tmp = t_4;
	elseif (Float64(b * a) <= 2.9e-94)
		tmp = t_2;
	elseif (Float64(b * a) <= 3.3e-6)
		tmp = t_4;
	elseif (Float64(b * a) <= 3.3e+112)
		tmp = t_2;
	else
		tmp = Float64(Float64(x * y) - t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (b * a) * 0.25;
	t_2 = c + (x * y);
	t_3 = 0.0625 * (z * t);
	t_4 = c + t_3;
	tmp = 0.0;
	if ((b * a) <= -2.8e+119)
		tmp = t_3 - t_1;
	elseif ((b * a) <= -9.2e-141)
		tmp = t_4;
	elseif ((b * a) <= -3.9e-218)
		tmp = t_2;
	elseif ((b * a) <= -7e-303)
		tmp = t_4;
	elseif ((b * a) <= 2.9e-94)
		tmp = t_2;
	elseif ((b * a) <= 3.3e-6)
		tmp = t_4;
	elseif ((b * a) <= 3.3e+112)
		tmp = t_2;
	else
		tmp = (x * y) - t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(c + t$95$3), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -2.8e+119], N[(t$95$3 - t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -9.2e-141], t$95$4, If[LessEqual[N[(b * a), $MachinePrecision], -3.9e-218], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -7e-303], t$95$4, If[LessEqual[N[(b * a), $MachinePrecision], 2.9e-94], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 3.3e-6], t$95$4, If[LessEqual[N[(b * a), $MachinePrecision], 3.3e+112], t$95$2, N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot a \leq -9.2 \cdot 10^{-141}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;b \cdot a \leq -3.9 \cdot 10^{-218}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq -7 \cdot 10^{-303}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;b \cdot a \leq 2.9 \cdot 10^{-94}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 3.3 \cdot 10^{-6}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;b \cdot a \leq 3.3 \cdot 10^{+112}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -2.80000000000000013e119

    1. Initial program 90.4%

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    3. Taylor expanded in c around 0 79.6%

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

    if -2.80000000000000013e119 < (*.f64 a b) < -9.1999999999999998e-141 or -3.9e-218 < (*.f64 a b) < -7e-303 or 2.89999999999999995e-94 < (*.f64 a b) < 3.30000000000000017e-6

    1. Initial program 100.0%

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

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

    if -9.1999999999999998e-141 < (*.f64 a b) < -3.9e-218 or -7e-303 < (*.f64 a b) < 2.89999999999999995e-94 or 3.30000000000000017e-6 < (*.f64 a b) < 3.2999999999999999e112

    1. Initial program 100.0%

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

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

    if 3.2999999999999999e112 < (*.f64 a b)

    1. Initial program 97.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -2.8 \cdot 10^{+119}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{elif}\;b \cdot a \leq -9.2 \cdot 10^{-141}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq -3.9 \cdot 10^{-218}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -7 \cdot 10^{-303}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 2.9 \cdot 10^{-94}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 3.3 \cdot 10^{-6}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 3.3 \cdot 10^{+112}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 8: 63.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + x \cdot y\\ t_3 := -0.25 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;b \cdot a \leq -6.5 \cdot 10^{+148}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \cdot a \leq -2.15 \cdot 10^{-151}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-218}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq -7.5 \cdot 10^{-304}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-94}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq 1.9 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq 2.1 \cdot 10^{+192}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* 0.0625 (* z t))))
        (t_2 (+ c (* x y)))
        (t_3 (* -0.25 (* b a))))
   (if (<= (* b a) -6.5e+148)
     t_3
     (if (<= (* b a) -2.15e-151)
       t_1
       (if (<= (* b a) -3.7e-218)
         t_2
         (if (<= (* b a) -7.5e-304)
           t_1
           (if (<= (* b a) 5.5e-94)
             t_2
             (if (<= (* b a) 1.9e-5)
               t_1
               (if (<= (* b a) 2.1e+192) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (0.0625 * (z * t));
	double t_2 = c + (x * y);
	double t_3 = -0.25 * (b * a);
	double tmp;
	if ((b * a) <= -6.5e+148) {
		tmp = t_3;
	} else if ((b * a) <= -2.15e-151) {
		tmp = t_1;
	} else if ((b * a) <= -3.7e-218) {
		tmp = t_2;
	} else if ((b * a) <= -7.5e-304) {
		tmp = t_1;
	} else if ((b * a) <= 5.5e-94) {
		tmp = t_2;
	} else if ((b * a) <= 1.9e-5) {
		tmp = t_1;
	} else if ((b * a) <= 2.1e+192) {
		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 + (0.0625d0 * (z * t))
    t_2 = c + (x * y)
    t_3 = (-0.25d0) * (b * a)
    if ((b * a) <= (-6.5d+148)) then
        tmp = t_3
    else if ((b * a) <= (-2.15d-151)) then
        tmp = t_1
    else if ((b * a) <= (-3.7d-218)) then
        tmp = t_2
    else if ((b * a) <= (-7.5d-304)) then
        tmp = t_1
    else if ((b * a) <= 5.5d-94) then
        tmp = t_2
    else if ((b * a) <= 1.9d-5) then
        tmp = t_1
    else if ((b * a) <= 2.1d+192) 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 + (0.0625 * (z * t));
	double t_2 = c + (x * y);
	double t_3 = -0.25 * (b * a);
	double tmp;
	if ((b * a) <= -6.5e+148) {
		tmp = t_3;
	} else if ((b * a) <= -2.15e-151) {
		tmp = t_1;
	} else if ((b * a) <= -3.7e-218) {
		tmp = t_2;
	} else if ((b * a) <= -7.5e-304) {
		tmp = t_1;
	} else if ((b * a) <= 5.5e-94) {
		tmp = t_2;
	} else if ((b * a) <= 1.9e-5) {
		tmp = t_1;
	} else if ((b * a) <= 2.1e+192) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (0.0625 * (z * t))
	t_2 = c + (x * y)
	t_3 = -0.25 * (b * a)
	tmp = 0
	if (b * a) <= -6.5e+148:
		tmp = t_3
	elif (b * a) <= -2.15e-151:
		tmp = t_1
	elif (b * a) <= -3.7e-218:
		tmp = t_2
	elif (b * a) <= -7.5e-304:
		tmp = t_1
	elif (b * a) <= 5.5e-94:
		tmp = t_2
	elif (b * a) <= 1.9e-5:
		tmp = t_1
	elif (b * a) <= 2.1e+192:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(0.0625 * Float64(z * t)))
	t_2 = Float64(c + Float64(x * y))
	t_3 = Float64(-0.25 * Float64(b * a))
	tmp = 0.0
	if (Float64(b * a) <= -6.5e+148)
		tmp = t_3;
	elseif (Float64(b * a) <= -2.15e-151)
		tmp = t_1;
	elseif (Float64(b * a) <= -3.7e-218)
		tmp = t_2;
	elseif (Float64(b * a) <= -7.5e-304)
		tmp = t_1;
	elseif (Float64(b * a) <= 5.5e-94)
		tmp = t_2;
	elseif (Float64(b * a) <= 1.9e-5)
		tmp = t_1;
	elseif (Float64(b * a) <= 2.1e+192)
		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 + (0.0625 * (z * t));
	t_2 = c + (x * y);
	t_3 = -0.25 * (b * a);
	tmp = 0.0;
	if ((b * a) <= -6.5e+148)
		tmp = t_3;
	elseif ((b * a) <= -2.15e-151)
		tmp = t_1;
	elseif ((b * a) <= -3.7e-218)
		tmp = t_2;
	elseif ((b * a) <= -7.5e-304)
		tmp = t_1;
	elseif ((b * a) <= 5.5e-94)
		tmp = t_2;
	elseif ((b * a) <= 1.9e-5)
		tmp = t_1;
	elseif ((b * a) <= 2.1e+192)
		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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -6.5e+148], t$95$3, If[LessEqual[N[(b * a), $MachinePrecision], -2.15e-151], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -3.7e-218], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -7.5e-304], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 5.5e-94], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 1.9e-5], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 2.1e+192], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot a \leq -2.15 \cdot 10^{-151}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-218}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq -7.5 \cdot 10^{-304}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-94}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 2.1 \cdot 10^{+192}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -6.49999999999999947e148 or 2.09999999999999995e192 < (*.f64 a b)

    1. Initial program 92.6%

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

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

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

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

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

    if -6.49999999999999947e148 < (*.f64 a b) < -2.15000000000000009e-151 or -3.7000000000000002e-218 < (*.f64 a b) < -7.50000000000000069e-304 or 5.49999999999999989e-94 < (*.f64 a b) < 1.9000000000000001e-5

    1. Initial program 100.0%

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

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

    if -2.15000000000000009e-151 < (*.f64 a b) < -3.7000000000000002e-218 or -7.50000000000000069e-304 < (*.f64 a b) < 5.49999999999999989e-94 or 1.9000000000000001e-5 < (*.f64 a b) < 2.09999999999999995e192

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -6.5 \cdot 10^{+148}:\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;b \cdot a \leq -2.15 \cdot 10^{-151}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-218}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -7.5 \cdot 10^{-304}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-94}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 1.9 \cdot 10^{-5}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 2.1 \cdot 10^{+192}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \end{array} \]

Alternative 9: 64.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + x \cdot y\\ t_3 := -0.25 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;b \cdot a \leq -6.5 \cdot 10^{+148}:\\ \;\;\;\;c + t_3\\ \mathbf{elif}\;b \cdot a \leq -6 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-218}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq -4.4 \cdot 10^{-304}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq 2.6 \cdot 10^{-94}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{-6}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq 1.05 \cdot 10^{+193}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* 0.0625 (* z t))))
        (t_2 (+ c (* x y)))
        (t_3 (* -0.25 (* b a))))
   (if (<= (* b a) -6.5e+148)
     (+ c t_3)
     (if (<= (* b a) -6e-165)
       t_1
       (if (<= (* b a) -3.7e-218)
         t_2
         (if (<= (* b a) -4.4e-304)
           t_1
           (if (<= (* b a) 2.6e-94)
             t_2
             (if (<= (* b a) 3e-6)
               t_1
               (if (<= (* b a) 1.05e+193) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (0.0625 * (z * t));
	double t_2 = c + (x * y);
	double t_3 = -0.25 * (b * a);
	double tmp;
	if ((b * a) <= -6.5e+148) {
		tmp = c + t_3;
	} else if ((b * a) <= -6e-165) {
		tmp = t_1;
	} else if ((b * a) <= -3.7e-218) {
		tmp = t_2;
	} else if ((b * a) <= -4.4e-304) {
		tmp = t_1;
	} else if ((b * a) <= 2.6e-94) {
		tmp = t_2;
	} else if ((b * a) <= 3e-6) {
		tmp = t_1;
	} else if ((b * a) <= 1.05e+193) {
		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 + (0.0625d0 * (z * t))
    t_2 = c + (x * y)
    t_3 = (-0.25d0) * (b * a)
    if ((b * a) <= (-6.5d+148)) then
        tmp = c + t_3
    else if ((b * a) <= (-6d-165)) then
        tmp = t_1
    else if ((b * a) <= (-3.7d-218)) then
        tmp = t_2
    else if ((b * a) <= (-4.4d-304)) then
        tmp = t_1
    else if ((b * a) <= 2.6d-94) then
        tmp = t_2
    else if ((b * a) <= 3d-6) then
        tmp = t_1
    else if ((b * a) <= 1.05d+193) 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 + (0.0625 * (z * t));
	double t_2 = c + (x * y);
	double t_3 = -0.25 * (b * a);
	double tmp;
	if ((b * a) <= -6.5e+148) {
		tmp = c + t_3;
	} else if ((b * a) <= -6e-165) {
		tmp = t_1;
	} else if ((b * a) <= -3.7e-218) {
		tmp = t_2;
	} else if ((b * a) <= -4.4e-304) {
		tmp = t_1;
	} else if ((b * a) <= 2.6e-94) {
		tmp = t_2;
	} else if ((b * a) <= 3e-6) {
		tmp = t_1;
	} else if ((b * a) <= 1.05e+193) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (0.0625 * (z * t))
	t_2 = c + (x * y)
	t_3 = -0.25 * (b * a)
	tmp = 0
	if (b * a) <= -6.5e+148:
		tmp = c + t_3
	elif (b * a) <= -6e-165:
		tmp = t_1
	elif (b * a) <= -3.7e-218:
		tmp = t_2
	elif (b * a) <= -4.4e-304:
		tmp = t_1
	elif (b * a) <= 2.6e-94:
		tmp = t_2
	elif (b * a) <= 3e-6:
		tmp = t_1
	elif (b * a) <= 1.05e+193:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(0.0625 * Float64(z * t)))
	t_2 = Float64(c + Float64(x * y))
	t_3 = Float64(-0.25 * Float64(b * a))
	tmp = 0.0
	if (Float64(b * a) <= -6.5e+148)
		tmp = Float64(c + t_3);
	elseif (Float64(b * a) <= -6e-165)
		tmp = t_1;
	elseif (Float64(b * a) <= -3.7e-218)
		tmp = t_2;
	elseif (Float64(b * a) <= -4.4e-304)
		tmp = t_1;
	elseif (Float64(b * a) <= 2.6e-94)
		tmp = t_2;
	elseif (Float64(b * a) <= 3e-6)
		tmp = t_1;
	elseif (Float64(b * a) <= 1.05e+193)
		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 + (0.0625 * (z * t));
	t_2 = c + (x * y);
	t_3 = -0.25 * (b * a);
	tmp = 0.0;
	if ((b * a) <= -6.5e+148)
		tmp = c + t_3;
	elseif ((b * a) <= -6e-165)
		tmp = t_1;
	elseif ((b * a) <= -3.7e-218)
		tmp = t_2;
	elseif ((b * a) <= -4.4e-304)
		tmp = t_1;
	elseif ((b * a) <= 2.6e-94)
		tmp = t_2;
	elseif ((b * a) <= 3e-6)
		tmp = t_1;
	elseif ((b * a) <= 1.05e+193)
		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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.25 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -6.5e+148], N[(c + t$95$3), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], -6e-165], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -3.7e-218], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -4.4e-304], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 2.6e-94], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 3e-6], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 1.05e+193], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot a \leq -6 \cdot 10^{-165}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-218}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq -4.4 \cdot 10^{-304}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 2.6 \cdot 10^{-94}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{-6}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 1.05 \cdot 10^{+193}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -6.49999999999999947e148

    1. Initial program 89.4%

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

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

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

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

    if -6.49999999999999947e148 < (*.f64 a b) < -5.99999999999999958e-165 or -3.7000000000000002e-218 < (*.f64 a b) < -4.4e-304 or 2.59999999999999994e-94 < (*.f64 a b) < 3.0000000000000001e-6

    1. Initial program 100.0%

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

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

    if -5.99999999999999958e-165 < (*.f64 a b) < -3.7000000000000002e-218 or -4.4e-304 < (*.f64 a b) < 2.59999999999999994e-94 or 3.0000000000000001e-6 < (*.f64 a b) < 1.05e193

    1. Initial program 100.0%

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

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

    if 1.05e193 < (*.f64 a b)

    1. Initial program 97.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -6.5 \cdot 10^{+148}:\\ \;\;\;\;c + -0.25 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;b \cdot a \leq -6 \cdot 10^{-165}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq -3.7 \cdot 10^{-218}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq -4.4 \cdot 10^{-304}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 2.6 \cdot 10^{-94}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{-6}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;b \cdot a \leq 1.05 \cdot 10^{+193}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \end{array} \]

Alternative 10: 74.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-36} \lor \neg \left(t \leq 1.45 \cdot 10^{+57} \lor \neg \left(t \leq 7.5 \cdot 10^{+97}\right) \land t \leq 5.1 \cdot 10^{+241}\right):\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= t -1.05e-36)
         (not (or (<= t 1.45e+57) (and (not (<= t 7.5e+97)) (<= t 5.1e+241)))))
   (+ c (* 0.0625 (* z t)))
   (- (+ c (* x y)) (* (* b a) 0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((t <= -1.05e-36) || !((t <= 1.45e+57) || (!(t <= 7.5e+97) && (t <= 5.1e+241)))) {
		tmp = c + (0.0625 * (z * t));
	} else {
		tmp = (c + (x * y)) - ((b * a) * 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 ((t <= (-1.05d-36)) .or. (.not. (t <= 1.45d+57) .or. (.not. (t <= 7.5d+97)) .and. (t <= 5.1d+241))) then
        tmp = c + (0.0625d0 * (z * t))
    else
        tmp = (c + (x * y)) - ((b * a) * 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 ((t <= -1.05e-36) || !((t <= 1.45e+57) || (!(t <= 7.5e+97) && (t <= 5.1e+241)))) {
		tmp = c + (0.0625 * (z * t));
	} else {
		tmp = (c + (x * y)) - ((b * a) * 0.25);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (t <= -1.05e-36) or not ((t <= 1.45e+57) or (not (t <= 7.5e+97) and (t <= 5.1e+241))):
		tmp = c + (0.0625 * (z * t))
	else:
		tmp = (c + (x * y)) - ((b * a) * 0.25)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((t <= -1.05e-36) || !((t <= 1.45e+57) || (!(t <= 7.5e+97) && (t <= 5.1e+241))))
		tmp = Float64(c + Float64(0.0625 * Float64(z * t)));
	else
		tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((t <= -1.05e-36) || ~(((t <= 1.45e+57) || (~((t <= 7.5e+97)) && (t <= 5.1e+241)))))
		tmp = c + (0.0625 * (z * t));
	else
		tmp = (c + (x * y)) - ((b * a) * 0.25);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.05e-36], N[Not[Or[LessEqual[t, 1.45e+57], And[N[Not[LessEqual[t, 7.5e+97]], $MachinePrecision], LessEqual[t, 5.1e+241]]]], $MachinePrecision]], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-36} \lor \neg \left(t \leq 1.45 \cdot 10^{+57} \lor \neg \left(t \leq 7.5 \cdot 10^{+97}\right) \land t \leq 5.1 \cdot 10^{+241}\right):\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.04999999999999995e-36 or 1.4500000000000001e57 < t < 7.5000000000000004e97 or 5.1000000000000002e241 < t

    1. Initial program 97.8%

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

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

    if -1.04999999999999995e-36 < t < 1.4500000000000001e57 or 7.5000000000000004e97 < t < 5.1000000000000002e241

    1. Initial program 97.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-36} \lor \neg \left(t \leq 1.45 \cdot 10^{+57} \lor \neg \left(t \leq 7.5 \cdot 10^{+97}\right) \land t \leq 5.1 \cdot 10^{+241}\right):\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 11: 83.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+37} \lor \neg \left(z \leq 7.5\right):\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t_1\\

\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.4999999999999995e37 or 7.5 < z

    1. Initial program 94.7%

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

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

    if -9.4999999999999995e37 < z < 7.5

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+37} \lor \neg \left(z \leq 7.5\right):\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 12: 97.7% accurate, 1.0× speedup?

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

\\
c + \left(\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{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. Final simplification97.6%

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

Alternative 13: 38.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{+38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-85}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;z \leq -1.44 \cdot 10^{-257}:\\ \;\;\;\;c\\ \mathbf{elif}\;z \leq 95:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))))
   (if (<= z -5.5e+38)
     t_1
     (if (<= z -4.4e-85)
       (* x y)
       (if (<= z -1.44e-257) c (if (<= z 95.0) (* x y) t_1))))))
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 (z <= -5.5e+38) {
		tmp = t_1;
	} else if (z <= -4.4e-85) {
		tmp = x * y;
	} else if (z <= -1.44e-257) {
		tmp = c;
	} else if (z <= 95.0) {
		tmp = x * y;
	} 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 = 0.0625d0 * (z * t)
    if (z <= (-5.5d+38)) then
        tmp = t_1
    else if (z <= (-4.4d-85)) then
        tmp = x * y
    else if (z <= (-1.44d-257)) then
        tmp = c
    else if (z <= 95.0d0) then
        tmp = x * y
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double tmp;
	if (z <= -5.5e+38) {
		tmp = t_1;
	} else if (z <= -4.4e-85) {
		tmp = x * y;
	} else if (z <= -1.44e-257) {
		tmp = c;
	} else if (z <= 95.0) {
		tmp = x * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	tmp = 0
	if z <= -5.5e+38:
		tmp = t_1
	elif z <= -4.4e-85:
		tmp = x * y
	elif z <= -1.44e-257:
		tmp = c
	elif z <= 95.0:
		tmp = x * y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	tmp = 0.0
	if (z <= -5.5e+38)
		tmp = t_1;
	elseif (z <= -4.4e-85)
		tmp = Float64(x * y);
	elseif (z <= -1.44e-257)
		tmp = c;
	elseif (z <= 95.0)
		tmp = Float64(x * y);
	else
		tmp = t_1;
	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 (z <= -5.5e+38)
		tmp = t_1;
	elseif (z <= -4.4e-85)
		tmp = x * y;
	elseif (z <= -1.44e-257)
		tmp = c;
	elseif (z <= 95.0)
		tmp = x * y;
	else
		tmp = t_1;
	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[LessEqual[z, -5.5e+38], t$95$1, If[LessEqual[z, -4.4e-85], N[(x * y), $MachinePrecision], If[LessEqual[z, -1.44e-257], c, If[LessEqual[z, 95.0], N[(x * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+38}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.4 \cdot 10^{-85}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;z \leq -1.44 \cdot 10^{-257}:\\
\;\;\;\;c\\

\mathbf{elif}\;z \leq 95:\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.5000000000000003e38 or 95 < z

    1. Initial program 94.6%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    3. Taylor expanded in t around inf 42.0%

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

    if -5.5000000000000003e38 < z < -4.4e-85 or -1.43999999999999992e-257 < z < 95

    1. Initial program 100.0%

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

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

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

    if -4.4e-85 < z < -1.43999999999999992e-257

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+38}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-85}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;z \leq -1.44 \cdot 10^{-257}:\\ \;\;\;\;c\\ \mathbf{elif}\;z \leq 95:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 14: 64.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.55 \cdot 10^{+119} \lor \neg \left(b \cdot a \leq 7 \cdot 10^{+189}\right):\\
\;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.54999999999999998e119 or 6.99999999999999991e189 < (*.f64 a b)

    1. Initial program 93.0%

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

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

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

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

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

    if -1.54999999999999998e119 < (*.f64 a b) < 6.99999999999999991e189

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot x} + c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1.55 \cdot 10^{+119} \lor \neg \left(b \cdot a \leq 7 \cdot 10^{+189}\right):\\ \;\;\;\;-0.25 \cdot \left(b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 15: 37.4% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.2 \cdot 10^{+109}:\\
\;\;\;\;c\\

\mathbf{elif}\;c \leq 2.4 \cdot 10^{+25}:\\
\;\;\;\;x \cdot y\\

\mathbf{else}:\\
\;\;\;\;c\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -8.19999999999999939e109 or 2.39999999999999996e25 < c

    1. Initial program 99.1%

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

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

    if -8.19999999999999939e109 < c < 2.39999999999999996e25

    1. Initial program 96.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.2 \cdot 10^{+109}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 2.4 \cdot 10^{+25}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 16: 21.7% 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. Taylor expanded in c around inf 24.1%

    \[\leadsto \color{blue}{c} \]
  3. Final simplification24.1%

    \[\leadsto c \]

Reproduce

?
herbie shell --seed 2023230 
(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))