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

Percentage Accurate: 67.4% → 96.0%
Time: 10.0s
Alternatives: 11
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));
}
real(8) function code(x, y, z, t)
    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 11 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: 67.4% 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));
}
real(8) function code(x, y, z, t)
    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: 96.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 2 \cdot 10^{+121}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z}{t \cdot t} \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \frac{x}{\frac{y \cdot y}{x}}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ (* z z) (* t t)) 2e+121)
   (fma (/ x y) (/ x y) (* (/ z (* t t)) z))
   (fma (/ z t) (/ z t) (/ x (/ (* y y) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z * z) / (t * t)) <= 2e+121) {
		tmp = fma((x / y), (x / y), ((z / (t * t)) * z));
	} else {
		tmp = fma((z / t), (z / t), (x / ((y * y) / x)));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(z * z) / Float64(t * t)) <= 2e+121)
		tmp = fma(Float64(x / y), Float64(x / y), Float64(Float64(z / Float64(t * t)) * z));
	else
		tmp = fma(Float64(z / t), Float64(z / t), Float64(x / Float64(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], 2e+121], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision] + N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision] + N[(x / N[(N[(y * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000007e121 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.0% 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^{-277}:\\ \;\;\;\;\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{x}{\frac{y}{x} \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* z z) (* t t))))
   (if (<= t_1 2e-277)
     (* (/ x y) (/ x y))
     (if (<= t_1 INFINITY)
       (fma (/ z (* t t)) z (* (/ x (* y y)) x))
       (/ x (* (/ y x) y))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * z) / (t * t);
	double tmp;
	if (t_1 <= 2e-277) {
		tmp = (x / y) * (x / y);
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = fma((z / (t * t)), z, ((x / (y * y)) * x));
	} else {
		tmp = x / ((y / x) * y);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(z * z) / Float64(t * t))
	tmp = 0.0
	if (t_1 <= 2e-277)
		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(x / Float64(Float64(y / x) * y));
	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-277], 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[(x / N[(N[(y / x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-277}:\\
\;\;\;\;\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{x}{\frac{y}{x} \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 1.99999999999999994e-277

    1. Initial program 69.9%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
      6. lower-*.f6473.5

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
    5. Applied rewrites73.5%

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

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

      if 1.99999999999999994e-277 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

      1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\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 t around inf

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
        6. lower-*.f6447.2

          \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
      5. Applied rewrites47.2%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
      6. Step-by-step derivation
        1. Applied rewrites47.2%

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

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

        Alternative 3: 81.1% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot z}{t \cdot t}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-118}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{\frac{z}{t} \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{x} \cdot y}\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (/ (* z z) (* t t))))
           (if (<= t_1 2e-118)
             (* (/ x y) (/ x y))
             (if (<= t_1 INFINITY) (/ (* (/ z t) z) t) (/ x (* (/ y x) y))))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (z * z) / (t * t);
        	double tmp;
        	if (t_1 <= 2e-118) {
        		tmp = (x / y) * (x / y);
        	} else if (t_1 <= ((double) INFINITY)) {
        		tmp = ((z / t) * z) / t;
        	} else {
        		tmp = x / ((y / x) * y);
        	}
        	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 <= 2e-118) {
        		tmp = (x / y) * (x / y);
        	} else if (t_1 <= Double.POSITIVE_INFINITY) {
        		tmp = ((z / t) * z) / t;
        	} else {
        		tmp = x / ((y / x) * y);
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = (z * z) / (t * t)
        	tmp = 0
        	if t_1 <= 2e-118:
        		tmp = (x / y) * (x / y)
        	elif t_1 <= math.inf:
        		tmp = ((z / t) * z) / t
        	else:
        		tmp = x / ((y / x) * y)
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(z * z) / Float64(t * t))
        	tmp = 0.0
        	if (t_1 <= 2e-118)
        		tmp = Float64(Float64(x / y) * Float64(x / y));
        	elseif (t_1 <= Inf)
        		tmp = Float64(Float64(Float64(z / t) * z) / t);
        	else
        		tmp = Float64(x / Float64(Float64(y / x) * y));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = (z * z) / (t * t);
        	tmp = 0.0;
        	if (t_1 <= 2e-118)
        		tmp = (x / y) * (x / y);
        	elseif (t_1 <= Inf)
        		tmp = ((z / t) * z) / t;
        	else
        		tmp = x / ((y / x) * y);
        	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[LessEqual[t$95$1, 2e-118], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], N[(x / N[(N[(y / x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \frac{z \cdot z}{t \cdot t}\\
        \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-118}:\\
        \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
        
        \mathbf{elif}\;t\_1 \leq \infty:\\
        \;\;\;\;\frac{\frac{z}{t} \cdot z}{t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x}{\frac{y}{x} \cdot y}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 1.99999999999999997e-118

          1. Initial program 70.3%

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

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

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

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

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

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

              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
            6. lower-*.f6470.8

              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
          5. Applied rewrites70.8%

            \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
          6. Step-by-step derivation
            1. Applied rewrites90.0%

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

            if 1.99999999999999997e-118 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

            1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{\frac{z}{t} \cdot z}{t}} \]
            5. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{\frac{z}{t} \cdot z}{t} \]
            7. Taylor expanded in t around 0

              \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
            8. 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. lower-/.f64N/A

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

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

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

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

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

              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 t around inf

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

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

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

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

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

                  \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                6. lower-*.f6447.2

                  \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
              5. Applied rewrites47.2%

                \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
              6. Step-by-step derivation
                1. Applied rewrites47.2%

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

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

                Alternative 4: 79.8% accurate, 0.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot z}{t \cdot t}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-118}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{x} \cdot y}\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (let* ((t_1 (/ (* z z) (* t t))))
                   (if (<= t_1 2e-118)
                     (* (/ x y) (/ x y))
                     (if (<= t_1 INFINITY) t_1 (/ x (* (/ y x) y))))))
                double code(double x, double y, double z, double t) {
                	double t_1 = (z * z) / (t * t);
                	double tmp;
                	if (t_1 <= 2e-118) {
                		tmp = (x / y) * (x / y);
                	} else if (t_1 <= ((double) INFINITY)) {
                		tmp = t_1;
                	} else {
                		tmp = x / ((y / x) * y);
                	}
                	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 <= 2e-118) {
                		tmp = (x / y) * (x / y);
                	} else if (t_1 <= Double.POSITIVE_INFINITY) {
                		tmp = t_1;
                	} else {
                		tmp = x / ((y / x) * y);
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	t_1 = (z * z) / (t * t)
                	tmp = 0
                	if t_1 <= 2e-118:
                		tmp = (x / y) * (x / y)
                	elif t_1 <= math.inf:
                		tmp = t_1
                	else:
                		tmp = x / ((y / x) * y)
                	return tmp
                
                function code(x, y, z, t)
                	t_1 = Float64(Float64(z * z) / Float64(t * t))
                	tmp = 0.0
                	if (t_1 <= 2e-118)
                		tmp = Float64(Float64(x / y) * Float64(x / y));
                	elseif (t_1 <= Inf)
                		tmp = t_1;
                	else
                		tmp = Float64(x / Float64(Float64(y / x) * y));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	t_1 = (z * z) / (t * t);
                	tmp = 0.0;
                	if (t_1 <= 2e-118)
                		tmp = (x / y) * (x / y);
                	elseif (t_1 <= Inf)
                		tmp = t_1;
                	else
                		tmp = x / ((y / x) * y);
                	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[LessEqual[t$95$1, 2e-118], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(x / N[(N[(y / x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \frac{z \cdot z}{t \cdot t}\\
                \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-118}:\\
                \;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
                
                \mathbf{elif}\;t\_1 \leq \infty:\\
                \;\;\;\;t\_1\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{x}{\frac{y}{x} \cdot y}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (/.f64 (*.f64 z z) (*.f64 t t)) < 1.99999999999999997e-118

                  1. Initial program 70.3%

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

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

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

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

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

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

                      \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                    6. lower-*.f6470.8

                      \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                  5. Applied rewrites70.8%

                    \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
                  6. Step-by-step derivation
                    1. Applied rewrites90.0%

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

                    if 1.99999999999999997e-118 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

                    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{\frac{z}{t} \cdot z}{t}} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{\frac{z}{t} \cdot z}{t} \]
                    7. Taylor expanded in t around 0

                      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                    8. 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. lower-/.f64N/A

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

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

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

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

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

                      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 t around inf

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

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

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

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

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

                          \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                        6. lower-*.f6447.2

                          \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                      5. Applied rewrites47.2%

                        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
                      6. Step-by-step derivation
                        1. Applied rewrites47.2%

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

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

                        Alternative 5: 80.1% accurate, 0.6× speedup?

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

                          1. Initial program 52.3%

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

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

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

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

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

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

                              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                            6. lower-*.f6464.8

                              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                          5. Applied rewrites64.8%

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

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

                            if 1.99999999999999997e-118 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0

                            1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{\frac{z}{t} \cdot z}{t}} \]
                            5. Step-by-step derivation
                              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{\frac{z}{t} \cdot z}{t} \]
                            7. Taylor expanded in t around 0

                              \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                            8. 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. lower-/.f64N/A

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

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

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

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

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

                            Alternative 6: 73.2% accurate, 0.6× speedup?

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

                              1. Initial program 51.6%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{\frac{z}{t} \cdot z}{t}} \]
                              5. Step-by-step derivation
                                1. lift-/.f64N/A

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\color{blue}{\frac{x}{y}} \cdot x}{y} + \frac{\frac{z}{t} \cdot z}{t} \]
                              6. Applied rewrites92.2%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{\frac{z}{t} \cdot z}{t} \]
                              7. Taylor expanded in t around 0

                                \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                              8. 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. lower-/.f64N/A

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

                                  \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                6. lower-*.f6464.9

                                  \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                              9. Applied rewrites64.9%

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

                                  \[\leadsto \left(\frac{1}{t \cdot t} \cdot z\right) \cdot z \]

                                if 2.00000000000000006e-117 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0

                                1. Initial program 77.2%

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

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

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

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

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

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

                                    \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                  6. lower-*.f6484.8

                                    \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                5. Applied rewrites84.8%

                                  \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
                              11. Recombined 2 regimes into one program.
                              12. Add Preprocessing

                              Alternative 7: 96.0% accurate, 0.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 2 \cdot 10^{+121}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z}{t \cdot t} \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \frac{x}{y \cdot y} \cdot x\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (if (<= (/ (* z z) (* t t)) 2e+121)
                                 (fma (/ x y) (/ x y) (* (/ z (* t t)) z))
                                 (fma (/ z t) (/ z t) (* (/ x (* y y)) x))))
                              double code(double x, double y, double z, double t) {
                              	double tmp;
                              	if (((z * z) / (t * t)) <= 2e+121) {
                              		tmp = fma((x / y), (x / y), ((z / (t * t)) * z));
                              	} else {
                              		tmp = fma((z / t), (z / t), ((x / (y * y)) * x));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z, t)
                              	tmp = 0.0
                              	if (Float64(Float64(z * z) / Float64(t * t)) <= 2e+121)
                              		tmp = fma(Float64(x / y), Float64(x / y), Float64(Float64(z / Float64(t * t)) * z));
                              	else
                              		tmp = fma(Float64(z / t), Float64(z / t), 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], 2e+121], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision] + N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision] + 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 2 \cdot 10^{+121}:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z}{t \cdot t} \cdot z\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{z}{t}, \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.00000000000000007e121

                                1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if 2.00000000000000007e121 < (/.f64 (*.f64 z z) (*.f64 t t))

                                1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 8: 93.4% accurate, 0.6× speedup?

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

                                1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{\frac{z}{t} \cdot z}{t}} \]
                                5. Step-by-step derivation
                                  1. lift-/.f64N/A

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\color{blue}{\frac{x}{y}} \cdot x}{y} + \frac{\frac{z}{t} \cdot z}{t} \]
                                6. Applied rewrites97.6%

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{\frac{z}{t} \cdot z}{t} \]
                                7. Taylor expanded in t around 0

                                  \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                                8. 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. lower-/.f64N/A

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

                                    \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                  6. lower-*.f6473.0

                                    \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                9. Applied rewrites73.0%

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

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

                                  if 0.0 < (/.f64 (*.f64 x x) (*.f64 y y))

                                  1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 9: 73.4% accurate, 0.6× speedup?

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

                                  1. Initial program 51.6%

                                    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in t 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. lower-/.f64N/A

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

                                      \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                    6. lower-*.f6464.9

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

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

                                  if 2.00000000000000006e-117 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0

                                  1. Initial program 77.2%

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

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

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

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

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

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

                                      \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                    6. lower-*.f6484.8

                                      \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                  5. Applied rewrites84.8%

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

                                Alternative 10: 82.2% accurate, 0.8× speedup?

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

                                  1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{\frac{z}{t} \cdot z}{t}} \]
                                  5. Step-by-step derivation
                                    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{\frac{z}{t} \cdot z}{t} \]
                                  7. Taylor expanded in t around 0

                                    \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
                                  8. 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. lower-/.f64N/A

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

                                      \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                    6. lower-*.f6468.1

                                      \[\leadsto \frac{z}{\color{blue}{t \cdot t}} \cdot z \]
                                  9. Applied rewrites68.1%

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

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

                                    if 4.0000000000000002e-115 < (/.f64 (*.f64 x x) (*.f64 y y))

                                    1. Initial program 59.9%

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

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

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

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

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

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

                                        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                      6. lower-*.f6470.9

                                        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                    5. Applied rewrites70.9%

                                      \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites78.5%

                                        \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{x}{y}} \]
                                    7. Recombined 2 regimes into one program.
                                    8. Add Preprocessing

                                    Alternative 11: 53.1% accurate, 2.1× speedup?

                                    \[\begin{array}{l} \\ \frac{x}{y \cdot y} \cdot x \end{array} \]
                                    (FPCore (x y z t) :precision binary64 (* (/ x (* y y)) x))
                                    double code(double x, double y, double z, double t) {
                                    	return (x / (y * y)) * x;
                                    }
                                    
                                    real(8) function code(x, y, z, t)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        real(8), intent (in) :: z
                                        real(8), intent (in) :: t
                                        code = (x / (y * y)) * x
                                    end function
                                    
                                    public static double code(double x, double y, double z, double t) {
                                    	return (x / (y * y)) * x;
                                    }
                                    
                                    def code(x, y, z, t):
                                    	return (x / (y * y)) * x
                                    
                                    function code(x, y, z, t)
                                    	return Float64(Float64(x / Float64(y * y)) * x)
                                    end
                                    
                                    function tmp = code(x, y, z, t)
                                    	tmp = (x / (y * y)) * x;
                                    end
                                    
                                    code[x_, y_, z_, t_] := N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \frac{x}{y \cdot y} \cdot x
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 63.3%

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

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

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

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

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

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

                                        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                      6. lower-*.f6452.7

                                        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \cdot x \]
                                    5. Applied rewrites52.7%

                                      \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} \]
                                    6. 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);
                                    }
                                    
                                    real(8) function code(x, y, z, t)
                                        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 2024235 
                                    (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))))