Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1

Percentage Accurate: 66.2% → 95.4%
Time: 5.3s
Alternatives: 12
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
double code(double x, double y, double z, double t) {
	return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * x) / (y * y)) + ((z * z) / (t * t))
end function
public static double code(double x, double y, double z, double t) {
	return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
def code(x, y, z, t):
	return ((x * x) / (y * y)) + ((z * z) / (t * t))
function code(x, y, z, t)
	return Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(z * z) / Float64(t * t)))
end
function tmp = code(x, y, z, t)
	tmp = ((x * x) / (y * y)) + ((z * z) / (t * t));
end
code[x_, y_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\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 12 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: 66.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
double code(double x, double y, double z, double t) {
	return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * x) / (y * y)) + ((z * z) / (t * t))
end function
public static double code(double x, double y, double z, double t) {
	return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
def code(x, y, z, t):
	return ((x * x) / (y * y)) + ((z * z) / (t * t))
function code(x, y, z, t)
	return Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(z * z) / Float64(t * t)))
end
function tmp = code(x, y, z, t)
	tmp = ((x * x) / (y * y)) + ((z * z) / (t * t));
end
code[x_, y_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\end{array}

Alternative 1: 95.4% accurate, 0.3× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 3 \cdot 10^{-157}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m} \cdot x, \frac{t}{t \cdot y\_m}, \frac{\frac{z}{t} \cdot \left(\frac{z}{t} \cdot y\_m\right)}{y\_m}\right)\\ \mathbf{elif}\;y\_m \leq 4 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(-x, \frac{-x}{y\_m \cdot y\_m}, {\left(\frac{z}{t}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 3e-157)
   (fma (* (/ x y_m) x) (/ t (* t y_m)) (/ (* (/ z t) (* (/ z t) y_m)) y_m))
   (if (<= y_m 4e+152)
     (fma (- x) (/ (- x) (* y_m y_m)) (pow (/ z t) 2.0))
     (fma (/ (/ x y_m) y_m) x (/ (* (/ z t) z) t)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 3e-157) {
		tmp = fma(((x / y_m) * x), (t / (t * y_m)), (((z / t) * ((z / t) * y_m)) / y_m));
	} else if (y_m <= 4e+152) {
		tmp = fma(-x, (-x / (y_m * y_m)), pow((z / t), 2.0));
	} else {
		tmp = fma(((x / y_m) / y_m), x, (((z / t) * z) / t));
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 3e-157)
		tmp = fma(Float64(Float64(x / y_m) * x), Float64(t / Float64(t * y_m)), Float64(Float64(Float64(z / t) * Float64(Float64(z / t) * y_m)) / y_m));
	elseif (y_m <= 4e+152)
		tmp = fma(Float64(-x), Float64(Float64(-x) / Float64(y_m * y_m)), (Float64(z / t) ^ 2.0));
	else
		tmp = fma(Float64(Float64(x / y_m) / y_m), x, Float64(Float64(Float64(z / t) * z) / t));
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 3e-157], N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] * N[(t / N[(t * y$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z / t), $MachinePrecision] * N[(N[(z / t), $MachinePrecision] * y$95$m), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 4e+152], N[((-x) * N[((-x) / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 3 \cdot 10^{-157}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m} \cdot x, \frac{t}{t \cdot y\_m}, \frac{\frac{z}{t} \cdot \left(\frac{z}{t} \cdot y\_m\right)}{y\_m}\right)\\

\mathbf{elif}\;y\_m \leq 4 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{-x}{y\_m \cdot y\_m}, {\left(\frac{z}{t}\right)}^{2}\right)\\

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


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

    1. Initial program 71.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6497.3

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites97.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Applied rewrites93.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{{\left(\frac{z}{t}\right)}^{2} \cdot y}{y}\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{\color{blue}{{\left(\frac{z}{t}\right)}^{2} \cdot y}}{y}\right) \]
      2. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{{\color{blue}{\left(\frac{z}{t}\right)}}^{2} \cdot y}{y}\right) \]
      3. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{\color{blue}{{\left(\frac{z}{t}\right)}^{2}} \cdot y}{y}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{\color{blue}{\left(\frac{z}{t} \cdot \frac{z}{t}\right)} \cdot y}{y}\right) \]
      5. associate-*l*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{\frac{z}{t} \cdot \color{blue}{\left(\frac{z}{t} \cdot y\right)}}{y}\right) \]
      9. lift-/.f6493.1

        \[\leadsto \mathsf{fma}\left(\frac{x}{y} \cdot x, \frac{t}{t \cdot y}, \frac{\frac{z}{t} \cdot \left(\color{blue}{\frac{z}{t}} \cdot y\right)}{y}\right) \]
    7. Applied rewrites93.1%

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

    if 3e-157 < y < 4.0000000000000002e152

    1. Initial program 75.1%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. sqr-neg-revN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. pow2N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\mathsf{neg}\left(x\right)}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\mathsf{neg}\left(x\right)}{{y}^{2}} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{\mathsf{neg}\left(x\right)}{{y}^{2}}, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{-x}, \frac{\mathsf{neg}\left(x\right)}{{y}^{2}}, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(-x, \color{blue}{\frac{\mathsf{neg}\left(x\right)}{{y}^{2}}}, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(-x, \frac{\color{blue}{-x}}{{y}^{2}}, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. pow2N/A

        \[\leadsto \mathsf{fma}\left(-x, \frac{-x}{\color{blue}{y \cdot y}}, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(-x, \frac{-x}{\color{blue}{y \cdot y}}, \frac{{z}^{2}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(-x, \frac{-x}{y \cdot y}, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      20. pow2N/A

        \[\leadsto \mathsf{fma}\left(-x, \frac{-x}{y \cdot y}, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      21. times-fracN/A

        \[\leadsto \mathsf{fma}\left(-x, \frac{-x}{y \cdot y}, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      22. pow2N/A

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

        \[\leadsto \mathsf{fma}\left(-x, \frac{-x}{y \cdot y}, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      24. lower-/.f6499.6

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

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

    if 4.0000000000000002e152 < y

    1. Initial program 53.2%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6493.4

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites93.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6493.6

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites93.6%

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

Alternative 2: 96.8% accurate, 0.3× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, {\left(\frac{z}{t}\right)}^{2}\right) \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (fma (/ (/ x y_m) y_m) x (pow (/ z t) 2.0)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	return fma(((x / y_m) / y_m), x, pow((z / t), 2.0));
}
y_m = abs(y)
function code(x, y_m, z, t)
	return fma(Float64(Float64(x / y_m) / y_m), x, (Float64(z / t) ^ 2.0))
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|

\\
\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, {\left(\frac{z}{t}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 70.5%

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    3. lift-*.f64N/A

      \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
    4. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    7. lift-/.f64N/A

      \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
    8. pow2N/A

      \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
    9. associate-/l*N/A

      \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
    10. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
    11. pow2N/A

      \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
    12. pow2N/A

      \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
    14. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    15. associate-/r*N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    16. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    17. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    18. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
    19. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
    20. times-fracN/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
    21. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
    22. lower-pow.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
    23. lower-/.f6497.5

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
  4. Applied rewrites97.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
  5. Add Preprocessing

Alternative 3: 76.5% accurate, 0.5× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \frac{z \cdot z}{t \cdot t}\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+16} \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot \frac{z \cdot y\_m}{t}}{y\_m \cdot t}\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (let* ((t_1 (/ (* z z) (* t t))))
   (if (or (<= t_1 5e+16) (not (<= t_1 INFINITY)))
     (* (/ (/ x y_m) y_m) x)
     (/ (* z (/ (* z y_m) t)) (* y_m t)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double t_1 = (z * z) / (t * t);
	double tmp;
	if ((t_1 <= 5e+16) || !(t_1 <= ((double) INFINITY))) {
		tmp = ((x / y_m) / y_m) * x;
	} else {
		tmp = (z * ((z * y_m) / t)) / (y_m * t);
	}
	return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double t_1 = (z * z) / (t * t);
	double tmp;
	if ((t_1 <= 5e+16) || !(t_1 <= Double.POSITIVE_INFINITY)) {
		tmp = ((x / y_m) / y_m) * x;
	} else {
		tmp = (z * ((z * y_m) / t)) / (y_m * t);
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	t_1 = (z * z) / (t * t)
	tmp = 0
	if (t_1 <= 5e+16) or not (t_1 <= math.inf):
		tmp = ((x / y_m) / y_m) * x
	else:
		tmp = (z * ((z * y_m) / t)) / (y_m * t)
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	t_1 = Float64(Float64(z * z) / Float64(t * t))
	tmp = 0.0
	if ((t_1 <= 5e+16) || !(t_1 <= Inf))
		tmp = Float64(Float64(Float64(x / y_m) / y_m) * x);
	else
		tmp = Float64(Float64(z * Float64(Float64(z * y_m) / t)) / Float64(y_m * t));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	t_1 = (z * z) / (t * t);
	tmp = 0.0;
	if ((t_1 <= 5e+16) || ~((t_1 <= Inf)))
		tmp = ((x / y_m) / y_m) * x;
	else
		tmp = (z * ((z * y_m) / t)) / (y_m * t);
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 5e+16], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x), $MachinePrecision], N[(N[(z * N[(N[(z * y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+16} \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \frac{z \cdot y\_m}{t}}{y\_m \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 5e16 or +inf.0 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 63.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6495.8

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites95.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6493.4

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites93.4%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6485.4

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites85.4%

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

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} \]
    10. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      6. frac-2negN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      7. associate-*l/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      8. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      9. frac-2neg-revN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      10. frac-addN/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{{y}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      12. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      13. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      14. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    11. Applied rewrites75.2%

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

    if 5e16 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

    1. Initial program 79.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites90.7%

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

      \[\leadsto \frac{\color{blue}{\frac{y \cdot {z}^{2}}{t}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{y \cdot {z}^{2}}{\color{blue}{t}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      5. lift-*.f6477.7

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
    7. Applied rewrites77.7%

      \[\leadsto \frac{\color{blue}{\frac{\left(z \cdot z\right) \cdot y}{t}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\frac{z \cdot \left(z \cdot y\right)}{t}}{y \cdot t} \]
      5. associate-/l*N/A

        \[\leadsto \frac{z \cdot \color{blue}{\frac{z \cdot y}{t}}}{y \cdot t} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{z \cdot \color{blue}{\frac{z \cdot y}{t}}}{y \cdot t} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{z \cdot \frac{z \cdot y}{\color{blue}{t}}}{y \cdot t} \]
      8. lower-*.f6481.6

        \[\leadsto \frac{z \cdot \frac{z \cdot y}{t}}{y \cdot t} \]
    9. Applied rewrites81.6%

      \[\leadsto \frac{z \cdot \color{blue}{\frac{z \cdot y}{t}}}{y \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{+16} \lor \neg \left(\frac{z \cdot z}{t \cdot t} \leq \infty\right):\\ \;\;\;\;\frac{\frac{x}{y}}{y} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot \frac{z \cdot y}{t}}{y \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.8% accurate, 0.6× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \frac{z \cdot z}{t \cdot t}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{+265}:\\ \;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{y\_m} + t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (let* ((t_1 (/ (* z z) (* t t))))
   (if (<= t_1 2e+265)
     (+ (* (/ x y_m) (/ x y_m)) t_1)
     (fma (/ x (* y_m y_m)) x (/ (* (/ z t) z) t)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double t_1 = (z * z) / (t * t);
	double tmp;
	if (t_1 <= 2e+265) {
		tmp = ((x / y_m) * (x / y_m)) + t_1;
	} else {
		tmp = fma((x / (y_m * y_m)), x, (((z / t) * z) / t));
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	t_1 = Float64(Float64(z * z) / Float64(t * t))
	tmp = 0.0
	if (t_1 <= 2e+265)
		tmp = Float64(Float64(Float64(x / y_m) * Float64(x / y_m)) + t_1);
	else
		tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) * z) / t));
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+265], N[(N[(N[(x / y$95$m), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+265}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{y\_m} + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 2.00000000000000013e265

    1. Initial program 79.2%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. times-fracN/A

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
      6. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{y}} \cdot \frac{x}{y} + \frac{z \cdot z}{t \cdot t} \]
      7. lower-/.f6496.8

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
    4. Applied rewrites96.8%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]

    if 2.00000000000000013e265 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 61.1%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6498.9

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites98.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6493.9

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites93.9%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6490.8

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites90.8%

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

Alternative 5: 74.7% accurate, 0.7× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{+31}:\\ \;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y\_m}{y\_m \cdot t}\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= (/ (* z z) (* t t)) 1e+31)
   (* (/ (/ x y_m) y_m) x)
   (/ (* (* (/ z t) z) y_m) (* y_m t))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (((z * z) / (t * t)) <= 1e+31) {
		tmp = ((x / y_m) / y_m) * x;
	} else {
		tmp = (((z / t) * z) * y_m) / (y_m * t);
	}
	return tmp;
}
y_m =     private
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_m, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z * z) / (t * t)) <= 1d+31) then
        tmp = ((x / y_m) / y_m) * x
    else
        tmp = (((z / t) * z) * y_m) / (y_m * t)
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if (((z * z) / (t * t)) <= 1e+31) {
		tmp = ((x / y_m) / y_m) * x;
	} else {
		tmp = (((z / t) * z) * y_m) / (y_m * t);
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if ((z * z) / (t * t)) <= 1e+31:
		tmp = ((x / y_m) / y_m) * x
	else:
		tmp = (((z / t) * z) * y_m) / (y_m * t)
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (Float64(Float64(z * z) / Float64(t * t)) <= 1e+31)
		tmp = Float64(Float64(Float64(x / y_m) / y_m) * x);
	else
		tmp = Float64(Float64(Float64(Float64(z / t) * z) * y_m) / Float64(y_m * t));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if (((z * z) / (t * t)) <= 1e+31)
		tmp = ((x / y_m) / y_m) * x;
	else
		tmp = (((z / t) * z) * y_m) / (y_m * t);
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 1e+31], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] * y$95$m), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{+31}:\\
\;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y\_m}{y\_m \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 9.9999999999999996e30

    1. Initial program 79.2%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6495.9

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites95.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6495.9

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites95.9%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6488.6

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites88.6%

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

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} \]
    10. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      6. frac-2negN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      7. associate-*l/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      8. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      9. frac-2neg-revN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      10. frac-addN/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{{y}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      12. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      13. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      14. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    11. Applied rewrites83.6%

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

    if 9.9999999999999996e30 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 62.9%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites82.1%

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

      \[\leadsto \frac{\color{blue}{\frac{y \cdot {z}^{2}}{t}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{y \cdot {z}^{2}}{\color{blue}{t}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      5. lift-*.f6463.5

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
    7. Applied rewrites63.5%

      \[\leadsto \frac{\color{blue}{\frac{\left(z \cdot z\right) \cdot y}{t}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      7. pow2N/A

        \[\leadsto \frac{\frac{z \cdot z}{t} \cdot y}{y \cdot t} \]
      8. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
      10. lift-*.f6471.6

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
    9. Applied rewrites71.6%

      \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot \color{blue}{y}}{y \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 73.9% accurate, 0.7× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{+16}:\\ \;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y\_m \cdot \frac{z}{t}\right) \cdot z}{y\_m \cdot t}\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= (/ (* z z) (* t t)) 5e+16)
   (* (/ (/ x y_m) y_m) x)
   (/ (* (* y_m (/ z t)) z) (* y_m t))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (((z * z) / (t * t)) <= 5e+16) {
		tmp = ((x / y_m) / y_m) * x;
	} else {
		tmp = ((y_m * (z / t)) * z) / (y_m * t);
	}
	return tmp;
}
y_m =     private
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_m, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z * z) / (t * t)) <= 5d+16) then
        tmp = ((x / y_m) / y_m) * x
    else
        tmp = ((y_m * (z / t)) * z) / (y_m * t)
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if (((z * z) / (t * t)) <= 5e+16) {
		tmp = ((x / y_m) / y_m) * x;
	} else {
		tmp = ((y_m * (z / t)) * z) / (y_m * t);
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if ((z * z) / (t * t)) <= 5e+16:
		tmp = ((x / y_m) / y_m) * x
	else:
		tmp = ((y_m * (z / t)) * z) / (y_m * t)
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (Float64(Float64(z * z) / Float64(t * t)) <= 5e+16)
		tmp = Float64(Float64(Float64(x / y_m) / y_m) * x);
	else
		tmp = Float64(Float64(Float64(y_m * Float64(z / t)) * z) / Float64(y_m * t));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if (((z * z) / (t * t)) <= 5e+16)
		tmp = ((x / y_m) / y_m) * x;
	else
		tmp = ((y_m * (z / t)) * z) / (y_m * t);
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 5e+16], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(y$95$m * N[(z / t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(y\_m \cdot \frac{z}{t}\right) \cdot z}{y\_m \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 5e16

    1. Initial program 78.8%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6495.8

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites95.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6495.9

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites95.9%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6488.4

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites88.4%

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

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} \]
    10. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      6. frac-2negN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      7. associate-*l/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      8. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      9. frac-2neg-revN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      10. frac-addN/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{{y}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      12. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      13. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      14. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    11. Applied rewrites84.1%

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

    if 5e16 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 63.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites82.3%

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

      \[\leadsto \frac{\color{blue}{\frac{y \cdot {z}^{2}}{t}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{y \cdot {z}^{2}}{\color{blue}{t}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      5. lift-*.f6463.3

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
    7. Applied rewrites63.3%

      \[\leadsto \frac{\color{blue}{\frac{\left(z \cdot z\right) \cdot y}{t}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      6. *-commutativeN/A

        \[\leadsto \frac{y \cdot \color{blue}{\frac{{z}^{2}}{t}}}{y \cdot t} \]
      7. pow2N/A

        \[\leadsto \frac{y \cdot \frac{z \cdot z}{t}}{y \cdot t} \]
      8. associate-*l/N/A

        \[\leadsto \frac{y \cdot \left(\frac{z}{t} \cdot \color{blue}{z}\right)}{y \cdot t} \]
      9. associate-*r*N/A

        \[\leadsto \frac{\left(y \cdot \frac{z}{t}\right) \cdot \color{blue}{z}}{y \cdot t} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\left(y \cdot \frac{z}{t}\right) \cdot \color{blue}{z}}{y \cdot t} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\left(y \cdot \frac{z}{t}\right) \cdot z}{y \cdot t} \]
      12. lift-/.f6470.0

        \[\leadsto \frac{\left(y \cdot \frac{z}{t}\right) \cdot z}{y \cdot t} \]
    9. Applied rewrites70.0%

      \[\leadsto \frac{\left(y \cdot \frac{z}{t}\right) \cdot \color{blue}{z}}{y \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 94.4% accurate, 0.7× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;z \leq 2.3 \cdot 10^{+221}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t}}{t} \cdot z\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= z 2.3e+221)
   (fma (/ (/ x y_m) y_m) x (/ (* (/ z t) z) t))
   (fma (/ x (* y_m y_m)) x (* (/ (/ z t) t) z))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (z <= 2.3e+221) {
		tmp = fma(((x / y_m) / y_m), x, (((z / t) * z) / t));
	} else {
		tmp = fma((x / (y_m * y_m)), x, (((z / t) / t) * z));
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (z <= 2.3e+221)
		tmp = fma(Float64(Float64(x / y_m) / y_m), x, Float64(Float64(Float64(z / t) * z) / t));
	else
		tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) / t) * z));
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[z, 2.3e+221], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.3 \cdot 10^{+221}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.29999999999999987e221

    1. Initial program 70.2%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6497.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites97.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6495.4

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites95.4%

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

    if 2.29999999999999987e221 < z

    1. Initial program 73.1%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6495.6

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites95.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6491.5

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites91.5%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6491.5

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites91.5%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{z \cdot \frac{z}{t}}}{t}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{z \cdot \frac{\frac{z}{t}}{t}}\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, z \cdot \color{blue}{\frac{z}{t \cdot t}}\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, z \cdot \frac{z}{\color{blue}{{t}^{2}}}\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{z}{{t}^{2}} \cdot z}\right) \]
      10. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{z}{\color{blue}{t \cdot t}} \cdot z\right) \]
      11. associate-/r*N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{\frac{z}{t}}{t}} \cdot z\right) \]
      13. lift-/.f6495.6

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\frac{z}{t}}}{t} \cdot z\right) \]
    10. Applied rewrites95.6%

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

Alternative 8: 87.9% accurate, 0.8× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \cdot y\_m \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{\left(\frac{x}{y\_m} \cdot x\right) \cdot t}{y\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= (* y_m y_m) 5e-315)
   (/ (* (* (/ x y_m) x) t) (* y_m t))
   (fma (/ x (* y_m y_m)) x (/ (* (/ z t) z) t))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if ((y_m * y_m) <= 5e-315) {
		tmp = (((x / y_m) * x) * t) / (y_m * t);
	} else {
		tmp = fma((x / (y_m * y_m)), x, (((z / t) * z) / t));
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (Float64(y_m * y_m) <= 5e-315)
		tmp = Float64(Float64(Float64(Float64(x / y_m) * x) * t) / Float64(y_m * t));
	else
		tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) * z) / t));
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 5e-315], N[(N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{\left(\frac{x}{y\_m} \cdot x\right) \cdot t}{y\_m \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y y) < 5.0000000023e-315

    1. Initial program 73.3%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites95.3%

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

      \[\leadsto \frac{\color{blue}{\frac{t \cdot {x}^{2}}{y}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{t \cdot {x}^{2}}{\color{blue}{y}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
      5. lift-*.f6478.6

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
    7. Applied rewrites78.6%

      \[\leadsto \frac{\color{blue}{\frac{\left(x \cdot x\right) \cdot t}{y}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
      3. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\frac{t \cdot {x}^{2}}{y}}{y \cdot t} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\frac{t \cdot {x}^{2}}{\color{blue}{y}}}{y \cdot t} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      7. associate-*l/N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y} \cdot \color{blue}{t}}{y \cdot t} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y} \cdot \color{blue}{t}}{y \cdot t} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{x \cdot x}{y} \cdot t}{y \cdot t} \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{x}{y} \cdot x\right) \cdot t}{y \cdot t} \]
      11. lift-/.f64N/A

        \[\leadsto \frac{\left(\frac{x}{y} \cdot x\right) \cdot t}{y \cdot t} \]
      12. lift-*.f6494.3

        \[\leadsto \frac{\left(\frac{x}{y} \cdot x\right) \cdot t}{y \cdot t} \]
    9. Applied rewrites94.3%

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

    if 5.0000000023e-315 < (*.f64 y y)

    1. Initial program 69.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6498.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6495.5

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites95.5%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6492.7

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites92.7%

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

Alternative 9: 88.2% accurate, 0.8× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \cdot y\_m \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{\left(\frac{x}{y\_m} \cdot x\right) \cdot t}{y\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t}}{t} \cdot z\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= (* y_m y_m) 5e-315)
   (/ (* (* (/ x y_m) x) t) (* y_m t))
   (fma (/ x (* y_m y_m)) x (* (/ (/ z t) t) z))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if ((y_m * y_m) <= 5e-315) {
		tmp = (((x / y_m) * x) * t) / (y_m * t);
	} else {
		tmp = fma((x / (y_m * y_m)), x, (((z / t) / t) * z));
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (Float64(y_m * y_m) <= 5e-315)
		tmp = Float64(Float64(Float64(Float64(x / y_m) * x) * t) / Float64(y_m * t));
	else
		tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) / t) * z));
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 5e-315], N[(N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{\left(\frac{x}{y\_m} \cdot x\right) \cdot t}{y\_m \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y y) < 5.0000000023e-315

    1. Initial program 73.3%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites95.3%

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

      \[\leadsto \frac{\color{blue}{\frac{t \cdot {x}^{2}}{y}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{t \cdot {x}^{2}}{\color{blue}{y}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
      5. lift-*.f6478.6

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
    7. Applied rewrites78.6%

      \[\leadsto \frac{\color{blue}{\frac{\left(x \cdot x\right) \cdot t}{y}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(x \cdot x\right) \cdot t}{y}}{y \cdot t} \]
      3. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\frac{t \cdot {x}^{2}}{y}}{y \cdot t} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\frac{t \cdot {x}^{2}}{\color{blue}{y}}}{y \cdot t} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\frac{{x}^{2} \cdot t}{y}}{y \cdot t} \]
      7. associate-*l/N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y} \cdot \color{blue}{t}}{y \cdot t} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y} \cdot \color{blue}{t}}{y \cdot t} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{x \cdot x}{y} \cdot t}{y \cdot t} \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{x}{y} \cdot x\right) \cdot t}{y \cdot t} \]
      11. lift-/.f64N/A

        \[\leadsto \frac{\left(\frac{x}{y} \cdot x\right) \cdot t}{y \cdot t} \]
      12. lift-*.f6494.3

        \[\leadsto \frac{\left(\frac{x}{y} \cdot x\right) \cdot t}{y \cdot t} \]
    9. Applied rewrites94.3%

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

    if 5.0000000023e-315 < (*.f64 y y)

    1. Initial program 69.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6498.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites98.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6495.5

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites95.5%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6492.7

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites92.7%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{z \cdot \frac{z}{t}}}{t}\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{z \cdot \frac{\frac{z}{t}}{t}}\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, z \cdot \color{blue}{\frac{z}{t \cdot t}}\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, z \cdot \frac{z}{\color{blue}{{t}^{2}}}\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{z}{{t}^{2}} \cdot z}\right) \]
      10. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{z}{\color{blue}{t \cdot t}} \cdot z\right) \]
      11. associate-/r*N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{\frac{z}{t}}{t}} \cdot z\right) \]
      13. lift-/.f6491.4

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\frac{z}{t}}}{t} \cdot z\right) \]
    10. Applied rewrites91.4%

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

Alternative 10: 68.7% accurate, 0.8× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 8 \cdot 10^{-207}:\\ \;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y\_m}{y\_m \cdot t}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, z \cdot \frac{z}{t \cdot t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= t 8e-207)
   (/ (* (* (/ z t) z) y_m) (* y_m t))
   (if (<= t 1.65e+154)
     (fma (/ x (* y_m y_m)) x (* z (/ z (* t t))))
     (* (/ (/ x y_m) y_m) x))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (t <= 8e-207) {
		tmp = (((z / t) * z) * y_m) / (y_m * t);
	} else if (t <= 1.65e+154) {
		tmp = fma((x / (y_m * y_m)), x, (z * (z / (t * t))));
	} else {
		tmp = ((x / y_m) / y_m) * x;
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (t <= 8e-207)
		tmp = Float64(Float64(Float64(Float64(z / t) * z) * y_m) / Float64(y_m * t));
	elseif (t <= 1.65e+154)
		tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(z * Float64(z / Float64(t * t))));
	else
		tmp = Float64(Float64(Float64(x / y_m) / y_m) * x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[t, 8e-207], N[(N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] * y$95$m), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e+154], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 8 \cdot 10^{-207}:\\
\;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y\_m}{y\_m \cdot t}\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, z \cdot \frac{z}{t \cdot t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 7.9999999999999994e-207

    1. Initial program 63.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites81.8%

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

      \[\leadsto \frac{\color{blue}{\frac{y \cdot {z}^{2}}{t}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{y \cdot {z}^{2}}{\color{blue}{t}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      5. lift-*.f6447.0

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
    7. Applied rewrites47.0%

      \[\leadsto \frac{\color{blue}{\frac{\left(z \cdot z\right) \cdot y}{t}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      7. pow2N/A

        \[\leadsto \frac{\frac{z \cdot z}{t} \cdot y}{y \cdot t} \]
      8. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
      10. lift-*.f6454.1

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
    9. Applied rewrites54.1%

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

    if 7.9999999999999994e-207 < t < 1.65e154

    1. Initial program 84.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6499.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6498.5

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites98.5%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6494.4

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites94.4%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. sqr-neg-revN/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}}{t \cdot t}\right) \]
      7. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(\mathsf{neg}\left(z\right)\right)}{\color{blue}{{t}^{2}}}\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot \frac{\mathsf{neg}\left(z\right)}{{t}^{2}}}\right) \]
      9. lower-*.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \left(-z\right) \cdot \frac{\color{blue}{-z}}{{t}^{2}}\right) \]
      13. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \left(-z\right) \cdot \frac{-z}{\color{blue}{t \cdot t}}\right) \]
      14. lift-*.f6494.3

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

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

    if 1.65e154 < t

    1. Initial program 74.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6499.6

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6496.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites96.7%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6487.5

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites87.5%

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

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} \]
    10. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      6. frac-2negN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      7. associate-*l/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      8. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      9. frac-2neg-revN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      10. frac-addN/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{{y}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      12. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      13. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      14. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    11. Applied rewrites86.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8 \cdot 10^{-207}:\\ \;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y \cdot y}, x, z \cdot \frac{z}{t \cdot t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y} \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.7% accurate, 0.8× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 9.6 \cdot 10^{-207}:\\ \;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y\_m}{y\_m \cdot t}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{z \cdot z}{t \cdot t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y\_m}}{y\_m} \cdot x\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= t 9.6e-207)
   (/ (* (* (/ z t) z) y_m) (* y_m t))
   (if (<= t 1.25e+154)
     (fma (/ x (* y_m y_m)) x (/ (* z z) (* t t)))
     (* (/ (/ x y_m) y_m) x))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (t <= 9.6e-207) {
		tmp = (((z / t) * z) * y_m) / (y_m * t);
	} else if (t <= 1.25e+154) {
		tmp = fma((x / (y_m * y_m)), x, ((z * z) / (t * t)));
	} else {
		tmp = ((x / y_m) / y_m) * x;
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (t <= 9.6e-207)
		tmp = Float64(Float64(Float64(Float64(z / t) * z) * y_m) / Float64(y_m * t));
	elseif (t <= 1.25e+154)
		tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(z * z) / Float64(t * t)));
	else
		tmp = Float64(Float64(Float64(x / y_m) / y_m) * x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[t, 9.6e-207], N[(N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] * y$95$m), $MachinePrecision] / N[(y$95$m * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+154], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.6 \cdot 10^{-207}:\\
\;\;\;\;\frac{\left(\frac{z}{t} \cdot z\right) \cdot y\_m}{y\_m \cdot t}\\

\mathbf{elif}\;t \leq 1.25 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{z \cdot z}{t \cdot t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 9.59999999999999956e-207

    1. Initial program 63.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y}}{y}} + \frac{z \cdot z}{t \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      11. associate-/r*N/A

        \[\leadsto \frac{\frac{{x}^{2}}{y}}{y} + \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}} \]
      12. frac-addN/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{{x}^{2}}{y} \cdot t + y \cdot \frac{{z}^{2}}{t}}{y \cdot t}} \]
    4. Applied rewrites81.8%

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

      \[\leadsto \frac{\color{blue}{\frac{y \cdot {z}^{2}}{t}}}{y \cdot t} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\frac{y \cdot {z}^{2}}{\color{blue}{t}}}{y \cdot t} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      5. lift-*.f6447.0

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
    7. Applied rewrites47.0%

      \[\leadsto \frac{\color{blue}{\frac{\left(z \cdot z\right) \cdot y}{t}}}{y \cdot t} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\frac{\left(z \cdot z\right) \cdot y}{t}}{y \cdot t} \]
      4. pow2N/A

        \[\leadsto \frac{\frac{{z}^{2} \cdot y}{t}}{y \cdot t} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\frac{{z}^{2}}{t} \cdot \color{blue}{y}}{y \cdot t} \]
      7. pow2N/A

        \[\leadsto \frac{\frac{z \cdot z}{t} \cdot y}{y \cdot t} \]
      8. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
      10. lift-*.f6454.1

        \[\leadsto \frac{\left(\frac{z}{t} \cdot z\right) \cdot y}{y \cdot t} \]
    9. Applied rewrites54.1%

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

    if 9.59999999999999956e-207 < t < 1.25000000000000001e154

    1. Initial program 84.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6499.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6498.5

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites98.5%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6494.4

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites94.4%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      5. times-fracN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      7. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{\color{blue}{z \cdot z}}{t \cdot t}\right) \]
      8. lift-*.f6491.7

        \[\leadsto \mathsf{fma}\left(\frac{x}{y \cdot y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
    10. Applied rewrites91.7%

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

    if 1.25000000000000001e154 < t

    1. Initial program 74.6%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
      8. pow2N/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      9. associate-/l*N/A

        \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      11. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
      12. pow2N/A

        \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
      14. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      15. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      16. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      17. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
      18. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
      20. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
      21. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      22. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      23. lower-/.f6499.6

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
      2. unpow2N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
      11. lift-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
      12. lower-*.f6496.7

        \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    6. Applied rewrites96.7%

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
      7. lower-*.f6487.5

        \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    8. Applied rewrites87.5%

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

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} \]
    10. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      3. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      4. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      5. associate-/r*N/A

        \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
      6. frac-2negN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      7. associate-*l/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      8. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      9. frac-2neg-revN/A

        \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
      10. frac-addN/A

        \[\leadsto \frac{\color{blue}{{x}^{2}}}{{y}^{2}} \]
      11. unpow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      12. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      13. pow2N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
      14. associate-*r/N/A

        \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    11. Applied rewrites86.5%

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

Alternative 12: 57.2% accurate, 1.6× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \frac{\frac{x}{y\_m}}{y\_m} \cdot x \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t) :precision binary64 (* (/ (/ x y_m) y_m) x))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	return ((x / y_m) / y_m) * x;
}
y_m =     private
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_m, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x / y_m) / y_m) * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	return ((x / y_m) / y_m) * x;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	return ((x / y_m) / y_m) * x
y_m = abs(y)
function code(x, y_m, z, t)
	return Float64(Float64(Float64(x / y_m) / y_m) * x)
end
y_m = abs(y);
function tmp = code(x, y_m, z, t)
	tmp = ((x / y_m) / y_m) * x;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|

\\
\frac{\frac{x}{y\_m}}{y\_m} \cdot x
\end{array}
Derivation
  1. Initial program 70.5%

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{x \cdot x}}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    3. lift-*.f64N/A

      \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
    4. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{\color{blue}{z \cdot z}}{t \cdot t} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    7. lift-/.f64N/A

      \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
    8. pow2N/A

      \[\leadsto \frac{x \cdot x}{\color{blue}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
    9. associate-/l*N/A

      \[\leadsto \color{blue}{x \cdot \frac{x}{{y}^{2}}} + \frac{z \cdot z}{t \cdot t} \]
    10. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
    11. pow2N/A

      \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{\color{blue}{{z}^{2}}}{t \cdot t} \]
    12. pow2N/A

      \[\leadsto \frac{x}{{y}^{2}} \cdot x + \frac{{z}^{2}}{\color{blue}{{t}^{2}}} \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{{y}^{2}}, x, \frac{{z}^{2}}{{t}^{2}}\right)} \]
    14. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    15. associate-/r*N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    16. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\frac{x}{y}}{y}}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    17. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{{z}^{2}}{{t}^{2}}\right) \]
    18. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{z \cdot z}}{{t}^{2}}\right) \]
    19. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z \cdot z}{\color{blue}{t \cdot t}}\right) \]
    20. times-fracN/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\right) \]
    21. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
    22. lower-pow.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
    23. lower-/.f6497.5

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\color{blue}{\left(\frac{z}{t}\right)}}^{2}\right) \]
  4. Applied rewrites97.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, {\left(\frac{z}{t}\right)}^{2}\right)} \]
  5. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\right) \]
    2. unpow2N/A

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

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

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{z}{t} \cdot \color{blue}{\frac{z}{t}}\right) \]
    5. times-fracN/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{z \cdot z}{t \cdot t}}\right) \]
    6. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{{z}^{2}}}{t \cdot t}\right) \]
    7. associate-/r*N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
    8. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{{z}^{2}}{t}}{t}}\right) \]
    9. pow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\frac{\color{blue}{z \cdot z}}{t}}{t}\right) \]
    10. associate-*l/N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
    11. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t}} \cdot z}{t}\right) \]
    12. lower-*.f6495.1

      \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \frac{\color{blue}{\frac{z}{t} \cdot z}}{t}\right) \]
  6. Applied rewrites95.1%

    \[\leadsto \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, \color{blue}{\frac{\frac{z}{t} \cdot z}{t}}\right) \]
  7. Step-by-step derivation
    1. lift-/.f64N/A

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

      \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\frac{x}{y}}}{y}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    4. unpow2N/A

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{x}{{y}^{2}}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
    7. lower-*.f6489.9

      \[\leadsto \mathsf{fma}\left(\frac{x}{\color{blue}{y \cdot y}}, x, \frac{\frac{z}{t} \cdot z}{t}\right) \]
  8. Applied rewrites89.9%

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

    \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} \]
  10. Step-by-step derivation
    1. pow2N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    2. associate-*l/N/A

      \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
    3. pow2N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    4. unpow2N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    5. associate-/r*N/A

      \[\leadsto \frac{{\color{blue}{x}}^{2}}{{y}^{2}} \]
    6. frac-2negN/A

      \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
    7. associate-*l/N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    8. pow2N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    9. frac-2neg-revN/A

      \[\leadsto \frac{{x}^{\color{blue}{2}}}{{y}^{2}} \]
    10. frac-addN/A

      \[\leadsto \frac{\color{blue}{{x}^{2}}}{{y}^{2}} \]
    11. unpow2N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    12. associate-*r/N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    13. pow2N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
    14. associate-*r/N/A

      \[\leadsto \frac{{x}^{2}}{{y}^{2}} \]
  11. Applied rewrites61.3%

    \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y} \cdot x} \]
  12. Add Preprocessing

Developer Target 1: 99.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ {\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ (pow (/ x y) 2.0) (pow (/ z t) 2.0)))
double code(double x, double y, double z, double t) {
	return pow((x / y), 2.0) + pow((z / t), 2.0);
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x / y) ** 2.0d0) + ((z / t) ** 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return Math.pow((x / y), 2.0) + Math.pow((z / t), 2.0);
}
def code(x, y, z, t):
	return math.pow((x / y), 2.0) + math.pow((z / t), 2.0)
function code(x, y, z, t)
	return Float64((Float64(x / y) ^ 2.0) + (Float64(z / t) ^ 2.0))
end
function tmp = code(x, y, z, t)
	tmp = ((x / y) ^ 2.0) + ((z / t) ^ 2.0);
end
code[x_, y_, z_, t_] := N[(N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}
\end{array}

Reproduce

?
herbie shell --seed 2025037 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (pow (/ x y) 2) (pow (/ z t) 2)))

  (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))