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

Percentage Accurate: 66.1% → 90.4%
Time: 9.1s
Alternatives: 10
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 10 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.1% 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: 90.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 69.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{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. associate-/r*N/A

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

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

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

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

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

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

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

    if 2.99999999999999983e204 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 57.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites95.6%

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

    Alternative 2: 85.8% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot z}{t \cdot t}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-264}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t \cdot t}, z, \frac{x}{y \cdot y} \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{z}{t}}{t} \cdot z\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (/ (* z z) (* t t))))
       (if (<= t_1 2e-264)
         (* (/ x y) (/ x y))
         (if (<= t_1 INFINITY)
           (fma (/ z (* t t)) z (* (/ x (* y y)) x))
           (* (/ (/ z t) t) z)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (z * z) / (t * t);
    	double tmp;
    	if (t_1 <= 2e-264) {
    		tmp = (x / y) * (x / y);
    	} else if (t_1 <= ((double) INFINITY)) {
    		tmp = fma((z / (t * t)), z, ((x / (y * y)) * x));
    	} else {
    		tmp = ((z / t) / t) * z;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(z * z) / Float64(t * t))
    	tmp = 0.0
    	if (t_1 <= 2e-264)
    		tmp = Float64(Float64(x / y) * Float64(x / y));
    	elseif (t_1 <= Inf)
    		tmp = fma(Float64(z / Float64(t * t)), z, Float64(Float64(x / Float64(y * y)) * x));
    	else
    		tmp = Float64(Float64(Float64(z / t) / t) * z);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-264], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z + N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{z \cdot z}{t \cdot t}\\
    \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-264}:\\
    \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
    
    \mathbf{elif}\;t\_1 \leq \infty:\\
    \;\;\;\;\mathsf{fma}\left(\frac{z}{t \cdot t}, z, \frac{x}{y \cdot y} \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{z}{t}}{t} \cdot z\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 2e-264

      1. Initial program 66.6%

        \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
      2. Add Preprocessing
      3. Applied rewrites94.9%

        \[\leadsto \color{blue}{\left(\frac{x}{y} + \frac{z}{t}\right) \cdot \left(\frac{x}{y} - \frac{z}{t}\right)} \]
      4. Taylor expanded in z around 0

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{t \cdot y} + \frac{x}{t \cdot y}\right) + \frac{{x}^{2}}{{y}^{2}}} \]
      5. Applied rewrites92.0%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{x}{y}, 0\right)}{y}} \]
      6. Step-by-step derivation
        1. Applied rewrites74.1%

          \[\leadsto \frac{\frac{x \cdot x}{y}}{y} \]
        2. Step-by-step derivation
          1. Applied rewrites95.0%

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

          if 2e-264 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

          1. Initial program 74.7%

            \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites91.9%

              \[\leadsto \mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{x}{y \cdot y} \cdot x\right) \]
            2. Step-by-step derivation
              1. Applied rewrites90.9%

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

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

              1. Initial program 0.0%

                \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
              4. Step-by-step derivation
                1. unpow2N/A

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

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

                  \[\leadsto \color{blue}{\frac{z}{{t}^{2}} \cdot z} \]
                4. unpow2N/A

                  \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                5. associate-/r*N/A

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

                  \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t}} \cdot z \]
                7. lower-/.f6456.2

                  \[\leadsto \frac{\color{blue}{\frac{z}{t}}}{t} \cdot z \]
              5. Applied rewrites56.2%

                \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t} \cdot z} \]
            3. Recombined 3 regimes into one program.
            4. Add Preprocessing

            Alternative 3: 80.9% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot z}{t \cdot t}\\ \mathbf{if}\;t\_1 \leq 10^{-162} \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t \cdot t} \cdot z\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (/ (* z z) (* t t))))
               (if (or (<= t_1 1e-162) (not (<= t_1 INFINITY)))
                 (* (/ x y) (/ x y))
                 (* (/ z (* t t)) z))))
            double code(double x, double y, double z, double t) {
            	double t_1 = (z * z) / (t * t);
            	double tmp;
            	if ((t_1 <= 1e-162) || !(t_1 <= ((double) INFINITY))) {
            		tmp = (x / y) * (x / y);
            	} else {
            		tmp = (z / (t * t)) * z;
            	}
            	return tmp;
            }
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = (z * z) / (t * t);
            	double tmp;
            	if ((t_1 <= 1e-162) || !(t_1 <= Double.POSITIVE_INFINITY)) {
            		tmp = (x / y) * (x / y);
            	} else {
            		tmp = (z / (t * t)) * z;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = (z * z) / (t * t)
            	tmp = 0
            	if (t_1 <= 1e-162) or not (t_1 <= math.inf):
            		tmp = (x / y) * (x / y)
            	else:
            		tmp = (z / (t * t)) * z
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(Float64(z * z) / Float64(t * t))
            	tmp = 0.0
            	if ((t_1 <= 1e-162) || !(t_1 <= Inf))
            		tmp = Float64(Float64(x / y) * Float64(x / y));
            	else
            		tmp = Float64(Float64(z / Float64(t * t)) * z);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = (z * z) / (t * t);
            	tmp = 0.0;
            	if ((t_1 <= 1e-162) || ~((t_1 <= Inf)))
            		tmp = (x / y) * (x / y);
            	else
            		tmp = (z / (t * t)) * z;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 1e-162], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \frac{z \cdot z}{t \cdot t}\\
            \mathbf{if}\;t\_1 \leq 10^{-162} \lor \neg \left(t\_1 \leq \infty\right):\\
            \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{z}{t \cdot t} \cdot z\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 9.99999999999999954e-163 or +inf.0 < (/.f64 (*.f64 z z) (*.f64 t t))

              1. Initial program 52.0%

                \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
              2. Add Preprocessing
              3. Applied rewrites81.9%

                \[\leadsto \color{blue}{\left(\frac{x}{y} + \frac{z}{t}\right) \cdot \left(\frac{x}{y} - \frac{z}{t}\right)} \]
              4. Taylor expanded in z around 0

                \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{t \cdot y} + \frac{x}{t \cdot y}\right) + \frac{{x}^{2}}{{y}^{2}}} \]
              5. Applied rewrites80.2%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{x}{y}, 0\right)}{y}} \]
              6. Step-by-step derivation
                1. Applied rewrites66.9%

                  \[\leadsto \frac{\frac{x \cdot x}{y}}{y} \]
                2. Step-by-step derivation
                  1. Applied rewrites82.3%

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

                  if 9.99999999999999954e-163 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

                  1. Initial program 74.4%

                    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                  4. Step-by-step derivation
                    1. unpow2N/A

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

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

                      \[\leadsto \color{blue}{\frac{z}{{t}^{2}} \cdot z} \]
                    4. unpow2N/A

                      \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                    5. associate-/r*N/A

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

                      \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t}} \cdot z \]
                    7. lower-/.f6481.4

                      \[\leadsto \frac{\color{blue}{\frac{z}{t}}}{t} \cdot z \]
                  5. Applied rewrites81.4%

                    \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t} \cdot z} \]
                  6. Step-by-step derivation
                    1. Applied rewrites81.0%

                      \[\leadsto \frac{z}{t \cdot t} \cdot z \]
                  7. Recombined 2 regimes into one program.
                  8. Final simplification81.7%

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

                  Alternative 4: 91.4% accurate, 0.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t \cdot t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{x}{y \cdot y} \cdot x\right)\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= (/ (* z z) (* t t)) 1e+118)
                     (fma (/ z (* t t)) z (* (/ (/ x y) y) x))
                     (fma (/ (/ z t) t) z (* (/ x (* y y)) x))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (((z * z) / (t * t)) <= 1e+118) {
                  		tmp = fma((z / (t * t)), z, (((x / y) / y) * x));
                  	} else {
                  		tmp = fma(((z / t) / t), z, ((x / (y * y)) * x));
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (Float64(Float64(z * z) / Float64(t * t)) <= 1e+118)
                  		tmp = fma(Float64(z / Float64(t * t)), z, Float64(Float64(Float64(x / y) / y) * x));
                  	else
                  		tmp = fma(Float64(Float64(z / t) / t), z, Float64(Float64(x / Float64(y * y)) * x));
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 1e+118], N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z + N[(N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision] * z + N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{+118}:\\
                  \;\;\;\;\mathsf{fma}\left(\frac{z}{t \cdot t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{x}{y \cdot y} \cdot x\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 9.99999999999999967e117

                    1. Initial program 68.6%

                      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                    2. Add Preprocessing
                    3. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites92.6%

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

                      if 9.99999999999999967e117 < (/.f64 (*.f64 z z) (*.f64 t t))

                      1. Initial program 58.9%

                        \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                      2. Add Preprocessing
                      3. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites95.1%

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

                      Alternative 5: 91.0% accurate, 0.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{x \cdot x}{y \cdot y} \leq 10^{-257}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t \cdot t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (<= (/ (* x x) (* y y)) 1e-257)
                         (* (/ z t) (/ z t))
                         (fma (/ z (* t t)) z (* (/ (/ x y) y) x))))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (((x * x) / (y * y)) <= 1e-257) {
                      		tmp = (z / t) * (z / t);
                      	} else {
                      		tmp = fma((z / (t * t)), z, (((x / y) / y) * x));
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if (Float64(Float64(x * x) / Float64(y * y)) <= 1e-257)
                      		tmp = Float64(Float64(z / t) * Float64(z / t));
                      	else
                      		tmp = fma(Float64(z / Float64(t * t)), z, Float64(Float64(Float64(x / y) / y) * x));
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision], 1e-257], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z + N[(N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\frac{x \cdot x}{y \cdot y} \leq 10^{-257}:\\
                      \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\frac{z}{t \cdot t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 (*.f64 x x) (*.f64 y y)) < 9.9999999999999998e-258

                        1. Initial program 67.0%

                          \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                        7. Step-by-step derivation
                          1. unpow2N/A

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

                            \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
                          3. times-fracN/A

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

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

                            \[\leadsto \color{blue}{\frac{z}{t}} \cdot \frac{z}{t} \]
                          6. lower-/.f6490.8

                            \[\leadsto \frac{z}{t} \cdot \color{blue}{\frac{z}{t}} \]
                        8. Applied rewrites90.8%

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

                        if 9.9999999999999998e-258 < (/.f64 (*.f64 x x) (*.f64 y y))

                        1. Initial program 61.9%

                          \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)} \]
                        6. Step-by-step derivation
                          1. Applied rewrites89.2%

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

                        Alternative 6: 71.4% accurate, 0.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot x}{y \cdot y}\\ \mathbf{if}\;t\_1 \leq 4000000000 \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;\frac{z}{t \cdot t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (let* ((t_1 (/ (* x x) (* y y))))
                           (if (or (<= t_1 4000000000.0) (not (<= t_1 INFINITY)))
                             (* (/ z (* t t)) z)
                             t_1)))
                        double code(double x, double y, double z, double t) {
                        	double t_1 = (x * x) / (y * y);
                        	double tmp;
                        	if ((t_1 <= 4000000000.0) || !(t_1 <= ((double) INFINITY))) {
                        		tmp = (z / (t * t)) * z;
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        public static double code(double x, double y, double z, double t) {
                        	double t_1 = (x * x) / (y * y);
                        	double tmp;
                        	if ((t_1 <= 4000000000.0) || !(t_1 <= Double.POSITIVE_INFINITY)) {
                        		tmp = (z / (t * t)) * z;
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	t_1 = (x * x) / (y * y)
                        	tmp = 0
                        	if (t_1 <= 4000000000.0) or not (t_1 <= math.inf):
                        		tmp = (z / (t * t)) * z
                        	else:
                        		tmp = t_1
                        	return tmp
                        
                        function code(x, y, z, t)
                        	t_1 = Float64(Float64(x * x) / Float64(y * y))
                        	tmp = 0.0
                        	if ((t_1 <= 4000000000.0) || !(t_1 <= Inf))
                        		tmp = Float64(Float64(z / Float64(t * t)) * z);
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	t_1 = (x * x) / (y * y);
                        	tmp = 0.0;
                        	if ((t_1 <= 4000000000.0) || ~((t_1 <= Inf)))
                        		tmp = (z / (t * t)) * z;
                        	else
                        		tmp = t_1;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 4000000000.0], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \frac{x \cdot x}{y \cdot y}\\
                        \mathbf{if}\;t\_1 \leq 4000000000 \lor \neg \left(t\_1 \leq \infty\right):\\
                        \;\;\;\;\frac{z}{t \cdot t} \cdot z\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (/.f64 (*.f64 x x) (*.f64 y y)) < 4e9 or +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y))

                          1. Initial program 55.3%

                            \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                          2. Add Preprocessing
                          3. Taylor expanded in x around 0

                            \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                          4. Step-by-step derivation
                            1. unpow2N/A

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

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

                              \[\leadsto \color{blue}{\frac{z}{{t}^{2}} \cdot z} \]
                            4. unpow2N/A

                              \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                            5. associate-/r*N/A

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

                              \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t}} \cdot z \]
                            7. lower-/.f6475.6

                              \[\leadsto \frac{\color{blue}{\frac{z}{t}}}{t} \cdot z \]
                          5. Applied rewrites75.6%

                            \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t} \cdot z} \]
                          6. Step-by-step derivation
                            1. Applied rewrites64.1%

                              \[\leadsto \frac{z}{t \cdot t} \cdot z \]

                            if 4e9 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0

                            1. Initial program 74.4%

                              \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                            2. Add Preprocessing
                            3. Applied rewrites75.3%

                              \[\leadsto \color{blue}{\left(\frac{x}{y} + \frac{z}{t}\right) \cdot \left(\frac{x}{y} - \frac{z}{t}\right)} \]
                            4. Taylor expanded in z around 0

                              \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{t \cdot y} + \frac{x}{t \cdot y}\right) + \frac{{x}^{2}}{{y}^{2}}} \]
                            5. Applied rewrites91.3%

                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{x}{y}, 0\right)}{y}} \]
                            6. Step-by-step derivation
                              1. Applied rewrites88.3%

                                \[\leadsto \frac{\frac{x \cdot x}{y}}{y} \]
                              2. Step-by-step derivation
                                1. Applied rewrites81.9%

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

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

                              Alternative 7: 93.7% accurate, 0.8× speedup?

                              \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right) \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (fma (/ (/ z t) t) z (* (/ (/ x y) y) x)))
                              double code(double x, double y, double z, double t) {
                              	return fma(((z / t) / t), z, (((x / y) / y) * x));
                              }
                              
                              function code(x, y, z, t)
                              	return fma(Float64(Float64(z / t) / t), z, Float64(Float64(Float64(x / y) / y) * x))
                              end
                              
                              code[x_, y_, z_, t_] := N[(N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision] * z + N[(N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              \mathsf{fma}\left(\frac{\frac{z}{t}}{t}, z, \frac{\frac{x}{y}}{y} \cdot x\right)
                              \end{array}
                              
                              Derivation
                              1. Initial program 63.5%

                                \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                              2. Add Preprocessing
                              3. Taylor expanded in x around 0

                                \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 8: 80.1% accurate, 0.8× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{-162}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{z}{t}}{t} \cdot z\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (if (<= (/ (* z z) (* t t)) 1e-162) (* (/ x y) (/ x y)) (* (/ (/ z t) t) z)))
                              double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (((z * z) / (t * t)) <= 1e-162) {
                              		tmp = (x / y) * (x / y);
                              	} else {
                              		tmp = ((z / t) / t) * z;
                              	}
                              	return tmp;
                              }
                              
                              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
                                  real(8) :: tmp
                                  if (((z * z) / (t * t)) <= 1d-162) then
                                      tmp = (x / y) * (x / y)
                                  else
                                      tmp = ((z / t) / t) * z
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (((z * z) / (t * t)) <= 1e-162) {
                              		tmp = (x / y) * (x / y);
                              	} else {
                              		tmp = ((z / t) / t) * z;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t):
                              	tmp = 0
                              	if ((z * z) / (t * t)) <= 1e-162:
                              		tmp = (x / y) * (x / y)
                              	else:
                              		tmp = ((z / t) / t) * z
                              	return tmp
                              
                              function code(x, y, z, t)
                              	tmp = 0.0
                              	if (Float64(Float64(z * z) / Float64(t * t)) <= 1e-162)
                              		tmp = Float64(Float64(x / y) * Float64(x / y));
                              	else
                              		tmp = Float64(Float64(Float64(z / t) / t) * z);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t)
                              	tmp = 0.0;
                              	if (((z * z) / (t * t)) <= 1e-162)
                              		tmp = (x / y) * (x / y);
                              	else
                              		tmp = ((z / t) / t) * z;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 1e-162], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{-162}:\\
                              \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{\frac{z}{t}}{t} \cdot z\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 9.99999999999999954e-163

                                1. Initial program 67.8%

                                  \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                                2. Add Preprocessing
                                3. Applied rewrites92.9%

                                  \[\leadsto \color{blue}{\left(\frac{x}{y} + \frac{z}{t}\right) \cdot \left(\frac{x}{y} - \frac{z}{t}\right)} \]
                                4. Taylor expanded in z around 0

                                  \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{t \cdot y} + \frac{x}{t \cdot y}\right) + \frac{{x}^{2}}{{y}^{2}}} \]
                                5. Applied rewrites90.3%

                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{x}{y}, 0\right)}{y}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites74.0%

                                    \[\leadsto \frac{\frac{x \cdot x}{y}}{y} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites93.0%

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

                                    if 9.99999999999999954e-163 < (/.f64 (*.f64 z z) (*.f64 t t))

                                    1. Initial program 60.9%

                                      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in x around 0

                                      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                                    4. Step-by-step derivation
                                      1. unpow2N/A

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

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

                                        \[\leadsto \color{blue}{\frac{z}{{t}^{2}} \cdot z} \]
                                      4. unpow2N/A

                                        \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                      5. associate-/r*N/A

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

                                        \[\leadsto \color{blue}{\frac{\frac{z}{t}}{t}} \cdot z \]
                                      7. lower-/.f6476.8

                                        \[\leadsto \frac{\color{blue}{\frac{z}{t}}}{t} \cdot z \]
                                    5. Applied rewrites76.8%

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

                                  Alternative 9: 81.4% accurate, 0.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{-162}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \end{array} \end{array} \]
                                  (FPCore (x y z t)
                                   :precision binary64
                                   (if (<= (/ (* z z) (* t t)) 1e-162) (* (/ x y) (/ x y)) (* (/ z t) (/ z t))))
                                  double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if (((z * z) / (t * t)) <= 1e-162) {
                                  		tmp = (x / y) * (x / y);
                                  	} else {
                                  		tmp = (z / t) * (z / t);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  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
                                      real(8) :: tmp
                                      if (((z * z) / (t * t)) <= 1d-162) then
                                          tmp = (x / y) * (x / y)
                                      else
                                          tmp = (z / t) * (z / t)
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if (((z * z) / (t * t)) <= 1e-162) {
                                  		tmp = (x / y) * (x / y);
                                  	} else {
                                  		tmp = (z / t) * (z / t);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t):
                                  	tmp = 0
                                  	if ((z * z) / (t * t)) <= 1e-162:
                                  		tmp = (x / y) * (x / y)
                                  	else:
                                  		tmp = (z / t) * (z / t)
                                  	return tmp
                                  
                                  function code(x, y, z, t)
                                  	tmp = 0.0
                                  	if (Float64(Float64(z * z) / Float64(t * t)) <= 1e-162)
                                  		tmp = Float64(Float64(x / y) * Float64(x / y));
                                  	else
                                  		tmp = Float64(Float64(z / t) * Float64(z / t));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t)
                                  	tmp = 0.0;
                                  	if (((z * z) / (t * t)) <= 1e-162)
                                  		tmp = (x / y) * (x / y);
                                  	else
                                  		tmp = (z / t) * (z / t);
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 1e-162], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 10^{-162}:\\
                                  \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 9.99999999999999954e-163

                                    1. Initial program 67.8%

                                      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                                    2. Add Preprocessing
                                    3. Applied rewrites92.9%

                                      \[\leadsto \color{blue}{\left(\frac{x}{y} + \frac{z}{t}\right) \cdot \left(\frac{x}{y} - \frac{z}{t}\right)} \]
                                    4. Taylor expanded in z around 0

                                      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{t \cdot y} + \frac{x}{t \cdot y}\right) + \frac{{x}^{2}}{{y}^{2}}} \]
                                    5. Applied rewrites90.3%

                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{x}{y}, 0\right)}{y}} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites74.0%

                                        \[\leadsto \frac{\frac{x \cdot x}{y}}{y} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites93.0%

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

                                        if 9.99999999999999954e-163 < (/.f64 (*.f64 z z) (*.f64 t t))

                                        1. Initial program 60.9%

                                          \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in x around 0

                                          \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}} + \frac{{z}^{2}}{{t}^{2}}} \]
                                        4. Step-by-step derivation
                                          1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                                        7. Step-by-step derivation
                                          1. unpow2N/A

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

                                            \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
                                          3. times-fracN/A

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

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

                                            \[\leadsto \color{blue}{\frac{z}{t}} \cdot \frac{z}{t} \]
                                          6. lower-/.f6476.7

                                            \[\leadsto \frac{z}{t} \cdot \color{blue}{\frac{z}{t}} \]
                                        8. Applied rewrites76.7%

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

                                      Alternative 10: 48.9% accurate, 2.1× speedup?

                                      \[\begin{array}{l} \\ \frac{x \cdot x}{y \cdot y} \end{array} \]
                                      (FPCore (x y z t) :precision binary64 (/ (* x x) (* y y)))
                                      double code(double x, double y, double z, double t) {
                                      	return (x * x) / (y * y);
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(x, y, z, t)
                                      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)
                                      end function
                                      
                                      public static double code(double x, double y, double z, double t) {
                                      	return (x * x) / (y * y);
                                      }
                                      
                                      def code(x, y, z, t):
                                      	return (x * x) / (y * y)
                                      
                                      function code(x, y, z, t)
                                      	return Float64(Float64(x * x) / Float64(y * y))
                                      end
                                      
                                      function tmp = code(x, y, z, t)
                                      	tmp = (x * x) / (y * y);
                                      end
                                      
                                      code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \frac{x \cdot x}{y \cdot y}
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 63.5%

                                        \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                                      2. Add Preprocessing
                                      3. Applied rewrites52.8%

                                        \[\leadsto \color{blue}{\left(\frac{x}{y} + \frac{z}{t}\right) \cdot \left(\frac{x}{y} - \frac{z}{t}\right)} \]
                                      4. Taylor expanded in z around 0

                                        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{x}{t \cdot y} + \frac{x}{t \cdot y}\right) + \frac{{x}^{2}}{{y}^{2}}} \]
                                      5. Applied rewrites61.0%

                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, \frac{x}{y}, 0\right)}{y}} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites56.7%

                                          \[\leadsto \frac{\frac{x \cdot x}{y}}{y} \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites48.7%

                                            \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} \]
                                          2. 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 2025017 
                                          (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))))