Development.Shake.Progress:decay from shake-0.15.5

Percentage Accurate: 65.5% → 96.2%
Time: 11.3s
Alternatives: 6
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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 6 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: 65.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 96.2% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b - y, z, y\right)\\ t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\ t_3 := \mathsf{fma}\left(z, \frac{t - a}{t\_1}, x \cdot \frac{y}{t\_1}\right)\\ t_4 := \frac{y}{{\left(b - y\right)}^{2}}\\ t_5 := \left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_4, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_4\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-304}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_5\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (fma (- b y) z y))
        (t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
        (t_3 (fma z (/ (- t a) t_1) (* x (/ y t_1))))
        (t_4 (/ y (pow (- b y) 2.0)))
        (t_5
         (-
          (+ (/ t (- b y)) (fma (/ a z) t_4 (* (/ x z) (/ y (- b y)))))
          (+ (/ a (- b y)) (* (/ t z) t_4)))))
   (if (<= t_2 (- INFINITY))
     t_3
     (if (<= t_2 -2e-304)
       t_2
       (if (<= t_2 0.0) t_5 (if (<= t_2 INFINITY) t_3 t_5))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma((b - y), z, y);
	double t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
	double t_3 = fma(z, ((t - a) / t_1), (x * (y / t_1)));
	double t_4 = y / pow((b - y), 2.0);
	double t_5 = ((t / (b - y)) + fma((a / z), t_4, ((x / z) * (y / (b - y))))) - ((a / (b - y)) + ((t / z) * t_4));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_2 <= -2e-304) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = t_5;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = t_5;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = fma(Float64(b - y), z, y)
	t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y))))
	t_3 = fma(z, Float64(Float64(t - a) / t_1), Float64(x * Float64(y / t_1)))
	t_4 = Float64(y / (Float64(b - y) ^ 2.0))
	t_5 = Float64(Float64(Float64(t / Float64(b - y)) + fma(Float64(a / z), t_4, Float64(Float64(x / z) * Float64(y / Float64(b - y))))) - Float64(Float64(a / Float64(b - y)) + Float64(Float64(t / z) * t_4)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_2 <= -2e-304)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = t_5;
	elseif (t_2 <= Inf)
		tmp = t_3;
	else
		tmp = t_5;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * t$95$4 + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-304], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$5, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$5]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - y, z, y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := \mathsf{fma}\left(z, \frac{t - a}{t\_1}, x \cdot \frac{y}{t\_1}\right)\\
t_4 := \frac{y}{{\left(b - y\right)}^{2}}\\
t_5 := \left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_4, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_4\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-304}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 71.4%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y + z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      4. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + \color{blue}{z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      7. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b - y\right)}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{z \cdot \left(b - y\right)}} \]
      9. div-add-revN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      10. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot \frac{t - a}{y + z \cdot \left(b - y\right)}} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)} \]
      12. lower-fma.f64N/A

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

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

    if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999994e-304

    1. Initial program 99.4%

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

    if -1.99999999999999994e-304 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y))))

    1. Initial program 10.9%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y + z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      4. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + \color{blue}{z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      7. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b - y\right)}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{z \cdot \left(b - y\right)}} \]
      9. div-add-revN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      10. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot \frac{t - a}{y + z \cdot \left(b - y\right)}} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)} \]
      12. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    5. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \color{blue}{\left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    6. Applied rewrites98.6%

      \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, \frac{y}{{\left(b - y\right)}^{2}}, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot \frac{y}{{\left(b - y\right)}^{2}}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 92.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right)\\ t_2 := y + z \cdot \left(b - y\right)\\ \mathbf{if}\;z \leq -3500000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-208}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \mathsf{fma}\left(-1, \frac{y \cdot z}{b}, \frac{y}{b}\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right)\\ \mathbf{elif}\;z \leq 390000000:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_2}, \frac{x}{a} \cdot \frac{y}{t\_2}\right), \frac{t \cdot z}{t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1
         (fma
          (* -1.0 (* (/ x z) (/ y (- b y))))
          -1.0
          (/ (* -1.0 (- t a)) (* -1.0 (- b y)))))
        (t_2 (+ y (* z (- b y)))))
   (if (<= z -3500000000000.0)
     t_1
     (if (<= z -3.3e-208)
       (fma
        z
        (/ (- t a) (* b (+ z (fma -1.0 (/ (* y z) b) (/ y b)))))
        (* x (/ y (fma (- b y) z y))))
       (if (<= z 390000000.0)
         (fma a (fma -1.0 (/ z t_2) (* (/ x a) (/ y t_2))) (/ (* t z) t_2))
         t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma((-1.0 * ((x / z) * (y / (b - y)))), -1.0, ((-1.0 * (t - a)) / (-1.0 * (b - y))));
	double t_2 = y + (z * (b - y));
	double tmp;
	if (z <= -3500000000000.0) {
		tmp = t_1;
	} else if (z <= -3.3e-208) {
		tmp = fma(z, ((t - a) / (b * (z + fma(-1.0, ((y * z) / b), (y / b))))), (x * (y / fma((b - y), z, y))));
	} else if (z <= 390000000.0) {
		tmp = fma(a, fma(-1.0, (z / t_2), ((x / a) * (y / t_2))), ((t * z) / t_2));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = fma(Float64(-1.0 * Float64(Float64(x / z) * Float64(y / Float64(b - y)))), -1.0, Float64(Float64(-1.0 * Float64(t - a)) / Float64(-1.0 * Float64(b - y))))
	t_2 = Float64(y + Float64(z * Float64(b - y)))
	tmp = 0.0
	if (z <= -3500000000000.0)
		tmp = t_1;
	elseif (z <= -3.3e-208)
		tmp = fma(z, Float64(Float64(t - a) / Float64(b * Float64(z + fma(-1.0, Float64(Float64(y * z) / b), Float64(y / b))))), Float64(x * Float64(y / fma(Float64(b - y), z, y))));
	elseif (z <= 390000000.0)
		tmp = fma(a, fma(-1.0, Float64(z / t_2), Float64(Float64(x / a) * Float64(y / t_2))), Float64(Float64(t * z) / t_2));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(-1.0 * N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(N[(-1.0 * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(-1.0 * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3500000000000.0], t$95$1, If[LessEqual[z, -3.3e-208], N[(z * N[(N[(t - a), $MachinePrecision] / N[(b * N[(z + N[(-1.0 * N[(N[(y * z), $MachinePrecision] / b), $MachinePrecision] + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / N[(N[(b - y), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 390000000.0], N[(a * N[(-1.0 * N[(z / t$95$2), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right)\\
t_2 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -3500000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.3 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \mathsf{fma}\left(-1, \frac{y \cdot z}{b}, \frac{y}{b}\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right)\\

\mathbf{elif}\;z \leq 390000000:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_2}, \frac{x}{a} \cdot \frac{y}{t\_2}\right), \frac{t \cdot z}{t\_2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5e12 or 3.9e8 < z

    1. Initial program 43.4%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \frac{t}{b - y}\right) - \frac{a}{b - y}} \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto -1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \color{blue}{\left(\frac{t}{b - y} - \frac{a}{b - y}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} \cdot -1 + \left(\color{blue}{\frac{t}{b - y}} - \frac{a}{b - y}\right) \]
      3. div-subN/A

        \[\leadsto \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} \cdot -1 + \frac{t - a}{\color{blue}{b - y}} \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z}, \color{blue}{-1}, \frac{t - a}{b - y}\right) \]
    4. Applied rewrites67.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{-1 \cdot \left(y \cdot x\right)}{b - y} - \frac{-1 \cdot \left(\left(t - a\right) \cdot y\right)}{{\left(b - y\right)}^{2}}}{z}, -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right)} \]
    5. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x \cdot y}{z \cdot \left(b - y\right)}, -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x \cdot y}{z \cdot \left(b - y\right)}, -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      2. times-fracN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      6. lift--.f6499.6

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
    7. Applied rewrites99.6%

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

    if -3.5e12 < z < -3.30000000000000006e-208

    1. Initial program 86.7%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y + z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      4. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + \color{blue}{z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      7. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b - y\right)}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{z \cdot \left(b - y\right)}} \]
      9. div-add-revN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      10. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot \frac{t - a}{y + z \cdot \left(b - y\right)}} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)} \]
      12. lower-fma.f64N/A

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

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

      \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{\color{blue}{b \cdot \left(z + \left(-1 \cdot \frac{y \cdot z}{b} + \frac{y}{b}\right)\right)}}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{b \cdot \color{blue}{\left(z + \left(-1 \cdot \frac{y \cdot z}{b} + \frac{y}{b}\right)\right)}}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
      2. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \color{blue}{\left(-1 \cdot \frac{y \cdot z}{b} + \frac{y}{b}\right)}\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \mathsf{fma}\left(-1, \color{blue}{\frac{y \cdot z}{b}}, \frac{y}{b}\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \mathsf{fma}\left(-1, \frac{y \cdot z}{\color{blue}{b}}, \frac{y}{b}\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \mathsf{fma}\left(-1, \frac{y \cdot z}{b}, \frac{y}{b}\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
      6. lower-/.f6490.7

        \[\leadsto \mathsf{fma}\left(z, \frac{t - a}{b \cdot \left(z + \mathsf{fma}\left(-1, \frac{y \cdot z}{b}, \frac{y}{b}\right)\right)}, x \cdot \frac{y}{\mathsf{fma}\left(b - y, z, y\right)}\right) \]
    6. Applied rewrites90.7%

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

    if -3.30000000000000006e-208 < z < 3.9e8

    1. Initial program 87.5%

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

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right) \cdot \color{blue}{a} \]
      2. lower-*.f64N/A

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right) \cdot a}\right) \cdot a} \]
    5. Taylor expanded in t around 0

      \[\leadsto a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right) + \color{blue}{\frac{t \cdot z}{y + z \cdot \left(b - y\right)}} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

      \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right)}, \frac{t \cdot z}{y + z \cdot \left(b - y\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 91.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + z \cdot \left(b - y\right)\\ t_2 := \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right)\\ \mathbf{if}\;z \leq -7000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 390000000:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_1}, \frac{x}{a} \cdot \frac{y}{t\_1}\right), \frac{t \cdot z}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (* z (- b y))))
        (t_2
         (fma
          (* -1.0 (* (/ x z) (/ y (- b y))))
          -1.0
          (/ (* -1.0 (- t a)) (* -1.0 (- b y))))))
   (if (<= z -7000000.0)
     t_2
     (if (<= z 390000000.0)
       (fma a (fma -1.0 (/ z t_1) (* (/ x a) (/ y t_1))) (/ (* t z) t_1))
       t_2))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (z * (b - y));
	double t_2 = fma((-1.0 * ((x / z) * (y / (b - y)))), -1.0, ((-1.0 * (t - a)) / (-1.0 * (b - y))));
	double tmp;
	if (z <= -7000000.0) {
		tmp = t_2;
	} else if (z <= 390000000.0) {
		tmp = fma(a, fma(-1.0, (z / t_1), ((x / a) * (y / t_1))), ((t * z) / t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(z * Float64(b - y)))
	t_2 = fma(Float64(-1.0 * Float64(Float64(x / z) * Float64(y / Float64(b - y)))), -1.0, Float64(Float64(-1.0 * Float64(t - a)) / Float64(-1.0 * Float64(b - y))))
	tmp = 0.0
	if (z <= -7000000.0)
		tmp = t_2;
	elseif (z <= 390000000.0)
		tmp = fma(a, fma(-1.0, Float64(z / t_1), Float64(Float64(x / a) * Float64(y / t_1))), Float64(Float64(t * z) / t_1));
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 * N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(N[(-1.0 * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(-1.0 * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7000000.0], t$95$2, If[LessEqual[z, 390000000.0], N[(a * N[(-1.0 * N[(z / t$95$1), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right)\\
\mathbf{if}\;z \leq -7000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 390000000:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_1}, \frac{x}{a} \cdot \frac{y}{t\_1}\right), \frac{t \cdot z}{t\_1}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7e6 or 3.9e8 < z

    1. Initial program 43.8%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \frac{t}{b - y}\right) - \frac{a}{b - y}} \]
    3. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto -1 \cdot \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} + \color{blue}{\left(\frac{t}{b - y} - \frac{a}{b - y}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} \cdot -1 + \left(\color{blue}{\frac{t}{b - y}} - \frac{a}{b - y}\right) \]
      3. div-subN/A

        \[\leadsto \frac{-1 \cdot \frac{x \cdot y}{b - y} - -1 \cdot \frac{y \cdot \left(t - a\right)}{{\left(b - y\right)}^{2}}}{z} \cdot -1 + \frac{t - a}{\color{blue}{b - y}} \]
      4. lower-fma.f64N/A

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{-1 \cdot \left(y \cdot x\right)}{b - y} - \frac{-1 \cdot \left(\left(t - a\right) \cdot y\right)}{{\left(b - y\right)}^{2}}}{z}, -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right)} \]
    5. Taylor expanded in x around inf

      \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x \cdot y}{z \cdot \left(b - y\right)}, -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x \cdot y}{z \cdot \left(b - y\right)}, -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      2. times-fracN/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
      6. lift--.f6499.4

        \[\leadsto \mathsf{fma}\left(-1 \cdot \left(\frac{x}{z} \cdot \frac{y}{b - y}\right), -1, \frac{-1 \cdot \left(t - a\right)}{-1 \cdot \left(b - y\right)}\right) \]
    7. Applied rewrites99.4%

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

    if -7e6 < z < 3.9e8

    1. Initial program 87.3%

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

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right) \cdot \color{blue}{a} \]
      2. lower-*.f64N/A

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right) \cdot a}\right) \cdot a} \]
    5. Taylor expanded in t around 0

      \[\leadsto a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right) + \color{blue}{\frac{t \cdot z}{y + z \cdot \left(b - y\right)}} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

Alternative 4: 89.7% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{{\left(b - y\right)}^{2}}\\ t_2 := y + z \cdot \left(b - y\right)\\ t_3 := \left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_1, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_1\right)\\ \mathbf{if}\;z \leq -7000000:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 390000000:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_2}, \frac{x}{a} \cdot \frac{y}{t\_2}\right), \frac{t \cdot z}{t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ y (pow (- b y) 2.0)))
        (t_2 (+ y (* z (- b y))))
        (t_3
         (-
          (+ (/ t (- b y)) (fma (/ a z) t_1 (* (/ x z) (/ y (- b y)))))
          (+ (/ a (- b y)) (* (/ t z) t_1)))))
   (if (<= z -7000000.0)
     t_3
     (if (<= z 390000000.0)
       (fma a (fma -1.0 (/ z t_2) (* (/ x a) (/ y t_2))) (/ (* t z) t_2))
       t_3))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y / pow((b - y), 2.0);
	double t_2 = y + (z * (b - y));
	double t_3 = ((t / (b - y)) + fma((a / z), t_1, ((x / z) * (y / (b - y))))) - ((a / (b - y)) + ((t / z) * t_1));
	double tmp;
	if (z <= -7000000.0) {
		tmp = t_3;
	} else if (z <= 390000000.0) {
		tmp = fma(a, fma(-1.0, (z / t_2), ((x / a) * (y / t_2))), ((t * z) / t_2));
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y / (Float64(b - y) ^ 2.0))
	t_2 = Float64(y + Float64(z * Float64(b - y)))
	t_3 = Float64(Float64(Float64(t / Float64(b - y)) + fma(Float64(a / z), t_1, Float64(Float64(x / z) * Float64(y / Float64(b - y))))) - Float64(Float64(a / Float64(b - y)) + Float64(Float64(t / z) * t_1)))
	tmp = 0.0
	if (z <= -7000000.0)
		tmp = t_3;
	elseif (z <= 390000000.0)
		tmp = fma(a, fma(-1.0, Float64(z / t_2), Float64(Float64(x / a) * Float64(y / t_2))), Float64(Float64(t * z) / t_2));
	else
		tmp = t_3;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * t$95$1 + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7000000.0], t$95$3, If[LessEqual[z, 390000000.0], N[(a * N[(-1.0 * N[(z / t$95$2), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{{\left(b - y\right)}^{2}}\\
t_2 := y + z \cdot \left(b - y\right)\\
t_3 := \left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_1, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_1\right)\\
\mathbf{if}\;z \leq -7000000:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 390000000:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_2}, \frac{x}{a} \cdot \frac{y}{t\_2}\right), \frac{t \cdot z}{t\_2}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7e6 or 3.9e8 < z

    1. Initial program 43.8%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y + z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      4. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + \color{blue}{z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      7. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b - y\right)}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{z \cdot \left(b - y\right)}} \]
      9. div-add-revN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      10. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot \frac{t - a}{y + z \cdot \left(b - y\right)}} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)} \]
      12. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    5. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \color{blue}{\left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    6. Applied rewrites95.0%

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

    if -7e6 < z < 3.9e8

    1. Initial program 87.3%

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

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right) \cdot \color{blue}{a} \]
      2. lower-*.f64N/A

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right) \cdot a}\right) \cdot a} \]
    5. Taylor expanded in t around 0

      \[\leadsto a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right) + \color{blue}{\frac{t \cdot z}{y + z \cdot \left(b - y\right)}} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

Alternative 5: 66.1% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{{\left(b - y\right)}^{2}}\\ t_2 := y + z \cdot \left(b - y\right)\\ t_3 := \left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_1, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_1\right)\\ \mathbf{if}\;z \leq -3.3:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 78000:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_2}, \frac{x}{a} \cdot \frac{y}{t\_2}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{\left(b \cdot b\right) \cdot z}, \frac{t}{b}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ y (pow (- b y) 2.0)))
        (t_2 (+ y (* z (- b y))))
        (t_3
         (-
          (+ (/ t (- b y)) (fma (/ a z) t_1 (* (/ x z) (/ y (- b y)))))
          (+ (/ a (- b y)) (* (/ t z) t_1)))))
   (if (<= z -3.3)
     t_3
     (if (<= z 78000.0)
       (fma
        a
        (fma -1.0 (/ z t_2) (* (/ x a) (/ y t_2)))
        (fma -1.0 (/ (* t (* y (+ 1.0 (* -1.0 z)))) (* (* b b) z)) (/ t b)))
       t_3))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y / pow((b - y), 2.0);
	double t_2 = y + (z * (b - y));
	double t_3 = ((t / (b - y)) + fma((a / z), t_1, ((x / z) * (y / (b - y))))) - ((a / (b - y)) + ((t / z) * t_1));
	double tmp;
	if (z <= -3.3) {
		tmp = t_3;
	} else if (z <= 78000.0) {
		tmp = fma(a, fma(-1.0, (z / t_2), ((x / a) * (y / t_2))), fma(-1.0, ((t * (y * (1.0 + (-1.0 * z)))) / ((b * b) * z)), (t / b)));
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y / (Float64(b - y) ^ 2.0))
	t_2 = Float64(y + Float64(z * Float64(b - y)))
	t_3 = Float64(Float64(Float64(t / Float64(b - y)) + fma(Float64(a / z), t_1, Float64(Float64(x / z) * Float64(y / Float64(b - y))))) - Float64(Float64(a / Float64(b - y)) + Float64(Float64(t / z) * t_1)))
	tmp = 0.0
	if (z <= -3.3)
		tmp = t_3;
	elseif (z <= 78000.0)
		tmp = fma(a, fma(-1.0, Float64(z / t_2), Float64(Float64(x / a) * Float64(y / t_2))), fma(-1.0, Float64(Float64(t * Float64(y * Float64(1.0 + Float64(-1.0 * z)))) / Float64(Float64(b * b) * z)), Float64(t / b)));
	else
		tmp = t_3;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * t$95$1 + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(t / z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3], t$95$3, If[LessEqual[z, 78000.0], N[(a * N[(-1.0 * N[(z / t$95$2), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t * N[(y * N[(1.0 + N[(-1.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{{\left(b - y\right)}^{2}}\\
t_2 := y + z \cdot \left(b - y\right)\\
t_3 := \left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_1, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_1\right)\\
\mathbf{if}\;z \leq -3.3:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 78000:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{t\_2}, \frac{x}{a} \cdot \frac{y}{t\_2}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{\left(b \cdot b\right) \cdot z}, \frac{t}{b}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2999999999999998 or 78000 < z

    1. Initial program 44.4%

      \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y + z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
      4. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + \color{blue}{z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
      6. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
      7. lift--.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b - y\right)}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{z \cdot \left(b - y\right)}} \]
      9. div-add-revN/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
      10. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot \frac{t - a}{y + z \cdot \left(b - y\right)}} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)} \]
      12. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    5. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \color{blue}{\left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
    6. Applied rewrites94.4%

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

    if -3.2999999999999998 < z < 78000

    1. Initial program 87.4%

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

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \left(\frac{t \cdot z}{a \cdot \left(y + z \cdot \left(b - y\right)\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right)\right) \cdot \color{blue}{a} \]
      2. lower-*.f64N/A

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\mathsf{fma}\left(b - y, z, y\right)}, -1, \frac{\mathsf{fma}\left(t, z, y \cdot x\right)}{\mathsf{fma}\left(b - y, z, y\right) \cdot a}\right) \cdot a} \]
    5. Taylor expanded in t around 0

      \[\leadsto a \cdot \left(-1 \cdot \frac{z}{y + z \cdot \left(b - y\right)} + \frac{x \cdot y}{a \cdot \left(y + z \cdot \left(b - y\right)\right)}\right) + \color{blue}{\frac{t \cdot z}{y + z \cdot \left(b - y\right)}} \]
    6. Step-by-step derivation
      1. lower-fma.f64N/A

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

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

      \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), -1 \cdot \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z} + \frac{t}{b}\right) \]
    9. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      2. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      5. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{{b}^{2} \cdot z}, \frac{t}{b}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{\left(b \cdot b\right) \cdot z}, \frac{t}{b}\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{\left(b \cdot b\right) \cdot z}, \frac{t}{b}\right)\right) \]
      10. lower-/.f6436.9

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{\left(b \cdot b\right) \cdot z}, \frac{t}{b}\right)\right) \]
    10. Applied rewrites36.9%

      \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(-1, \frac{z}{y + z \cdot \left(b - y\right)}, \frac{x}{a} \cdot \frac{y}{y + z \cdot \left(b - y\right)}\right), \mathsf{fma}\left(-1, \frac{t \cdot \left(y \cdot \left(1 + -1 \cdot z\right)\right)}{\left(b \cdot b\right) \cdot z}, \frac{t}{b}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 56.2% accurate, N/A× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y}{{\left(b - y\right)}^{2}}\\
\left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, t\_1, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot t\_1\right)
\end{array}
\end{array}
Derivation
  1. Initial program 65.5%

    \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
    2. lift-+.f64N/A

      \[\leadsto \frac{\color{blue}{x \cdot y + z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
    3. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{x \cdot y} + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)} \]
    4. lift--.f64N/A

      \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{x \cdot y + \color{blue}{z \cdot \left(t - a\right)}}{y + z \cdot \left(b - y\right)} \]
    6. lift-+.f64N/A

      \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{\color{blue}{y + z \cdot \left(b - y\right)}} \]
    7. lift--.f64N/A

      \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \color{blue}{\left(b - y\right)}} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{x \cdot y + z \cdot \left(t - a\right)}{y + \color{blue}{z \cdot \left(b - y\right)}} \]
    9. div-add-revN/A

      \[\leadsto \color{blue}{\frac{x \cdot y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}} \]
    10. +-commutativeN/A

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

      \[\leadsto \color{blue}{z \cdot \frac{t - a}{y + z \cdot \left(b - y\right)}} + \frac{x \cdot y}{y + z \cdot \left(b - y\right)} \]
    12. lower-fma.f64N/A

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

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

    \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
  5. Step-by-step derivation
    1. lower--.f64N/A

      \[\leadsto \left(\frac{t}{b - y} + \left(\frac{a \cdot y}{z \cdot {\left(b - y\right)}^{2}} + \frac{x \cdot y}{z \cdot \left(b - y\right)}\right)\right) - \color{blue}{\left(\frac{a}{b - y} + \frac{t \cdot y}{z \cdot {\left(b - y\right)}^{2}}\right)} \]
  6. Applied rewrites56.2%

    \[\leadsto \color{blue}{\left(\frac{t}{b - y} + \mathsf{fma}\left(\frac{a}{z}, \frac{y}{{\left(b - y\right)}^{2}}, \frac{x}{z} \cdot \frac{y}{b - y}\right)\right) - \left(\frac{a}{b - y} + \frac{t}{z} \cdot \frac{y}{{\left(b - y\right)}^{2}}\right)} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2025093 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64
  (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))