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

Percentage Accurate: 66.3% → 98.1%
Time: 5.6s
Alternatives: 9
Speedup: N/A×

Specification

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

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

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

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

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 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 66.3% accurate, 1.0× speedup?

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

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

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

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

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

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

\\
\begin{array}{l}
t_1 := \frac{-x}{y}\\
t_2 := \frac{-z}{t\_m}\\
\mathbf{if}\;t\_m \leq 5 \cdot 10^{-239}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, t\_2 \cdot t\_2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5e-239

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e-239 < t

    1. Initial program 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
\begin{array}{l}
t_1 := \frac{-x}{y}\\
t_2 := \frac{-z}{t\_m}\\
\mathbf{if}\;\frac{z \cdot z}{t\_m \cdot t\_m} \leq 10^{+288}:\\
\;\;\;\;\mathsf{fma}\left(-z, \frac{-z}{t\_m \cdot t\_m}, t\_1 \cdot t\_1\right)\\

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


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

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e288 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} t_1 := \frac{-z}{t\_m}\\ \mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, t\_1 \cdot t\_1\right) \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
 :precision binary64
 (let* ((t_1 (/ (- z) t_m))) (fma (/ (/ x y) y) x (* t_1 t_1))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
	double t_1 = -z / t_m;
	return fma(((x / y) / y), x, (t_1 * t_1));
}
t_m = abs(t)
function code(x, y, z, t_m)
	t_1 = Float64(Float64(-z) / t_m)
	return fma(Float64(Float64(x / y) / y), x, Float64(t_1 * t_1))
end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[((-z) / t$95$m), $MachinePrecision]}, N[(N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision] * x + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
t_1 := \frac{-z}{t\_m}\\
\mathsf{fma}\left(\frac{\frac{x}{y}}{y}, x, t\_1 \cdot t\_1\right)
\end{array}
\end{array}
Derivation
  1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999997e165 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot x}{y}} + \frac{z \cdot z}{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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{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-/.f6471.4

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0

    1. Initial program 75.2%

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

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

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

        \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{z \cdot z}{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-/.f6489.3

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

        \[\leadsto \frac{{y}^{2} \cdot \left(z \cdot \frac{z}{{t}^{2}}\right) + {x}^{2}}{{y}^{2}} \]
      5. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot z, \frac{\frac{z}{t}}{t}, x \cdot x\right)}{y \cdot \color{blue}{y}} \]
      17. lift-*.f640.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(\left(y \cdot y\right) \cdot z\right) \cdot \frac{\frac{z}{t}}{t} + x \cdot x}{y}}{\color{blue}{y}} \]
    6. Applied rewrites18.5%

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

Alternative 7: 76.0% accurate, N/A× speedup?

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

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

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


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

    1. Initial program 85.5%

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

    if +inf.0 < (+.f64 (/.f64 (*.f64 x x) (*.f64 y y)) (/.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. Taylor expanded in y around 0

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

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

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

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

        \[\leadsto \frac{{y}^{2} \cdot \left(z \cdot \frac{z}{{t}^{2}}\right) + {x}^{2}}{{y}^{2}} \]
      5. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(\left(y \cdot y\right) \cdot z\right) \cdot \frac{\frac{z}{t}}{t} + x \cdot x}{y}}{\color{blue}{y}} \]
    6. Applied rewrites42.9%

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

Alternative 8: 69.9% accurate, N/A× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} t_1 := {\left(-y\right)}^{-1}\\ t_2 := \frac{z}{t\_m} \cdot \frac{z}{t\_m}\\ t_3 := \frac{\frac{\mathsf{fma}\left(y \cdot y, t\_2, x \cdot x\right)}{y}}{y}\\ \mathbf{if}\;x \leq 6.5 \cdot 10^{-113}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, t\_1, \frac{t\_2}{x \cdot x}\right) \cdot \left(x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
 :precision binary64
 (let* ((t_1 (pow (- y) -1.0))
        (t_2 (* (/ z t_m) (/ z t_m)))
        (t_3 (/ (/ (fma (* y y) t_2 (* x x)) y) y)))
   (if (<= x 6.5e-113)
     t_3
     (if (<= x 1.35e+154) (* (fma t_1 t_1 (/ t_2 (* x x))) (* x x)) t_3))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
	double t_1 = pow(-y, -1.0);
	double t_2 = (z / t_m) * (z / t_m);
	double t_3 = (fma((y * y), t_2, (x * x)) / y) / y;
	double tmp;
	if (x <= 6.5e-113) {
		tmp = t_3;
	} else if (x <= 1.35e+154) {
		tmp = fma(t_1, t_1, (t_2 / (x * x))) * (x * x);
	} else {
		tmp = t_3;
	}
	return tmp;
}
t_m = abs(t)
function code(x, y, z, t_m)
	t_1 = Float64(-y) ^ -1.0
	t_2 = Float64(Float64(z / t_m) * Float64(z / t_m))
	t_3 = Float64(Float64(fma(Float64(y * y), t_2, Float64(x * x)) / y) / y)
	tmp = 0.0
	if (x <= 6.5e-113)
		tmp = t_3;
	elseif (x <= 1.35e+154)
		tmp = Float64(fma(t_1, t_1, Float64(t_2 / Float64(x * x))) * Float64(x * x));
	else
		tmp = t_3;
	end
	return tmp
end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[Power[(-y), -1.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / t$95$m), $MachinePrecision] * N[(z / t$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(y * y), $MachinePrecision] * t$95$2 + N[(x * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[x, 6.5e-113], t$95$3, If[LessEqual[x, 1.35e+154], N[(N[(t$95$1 * t$95$1 + N[(t$95$2 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
t_1 := {\left(-y\right)}^{-1}\\
t_2 := \frac{z}{t\_m} \cdot \frac{z}{t\_m}\\
t_3 := \frac{\frac{\mathsf{fma}\left(y \cdot y, t\_2, x \cdot x\right)}{y}}{y}\\
\mathbf{if}\;x \leq 6.5 \cdot 10^{-113}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_1, \frac{t\_2}{x \cdot x}\right) \cdot \left(x \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 6.49999999999999979e-113 or 1.35000000000000003e154 < x

    1. Initial program 63.4%

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

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

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

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

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

        \[\leadsto \frac{{y}^{2} \cdot \left(z \cdot \frac{z}{{t}^{2}}\right) + {x}^{2}}{{y}^{2}} \]
      5. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(\left(y \cdot y\right) \cdot z\right) \cdot \frac{\frac{z}{t}}{t} + x \cdot x}{y}}{\color{blue}{y}} \]
    6. Applied rewrites63.9%

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

    if 6.49999999999999979e-113 < x < 1.35000000000000003e154

    1. Initial program 77.0%

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

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

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

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

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

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

Alternative 9: 66.0% accurate, N/A× speedup?

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

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

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

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

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

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

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

      \[\leadsto \frac{{y}^{2} \cdot \left(z \cdot \frac{z}{{t}^{2}}\right) + {x}^{2}}{{y}^{2}} \]
    5. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\left(\left(y \cdot y\right) \cdot z\right) \cdot \frac{\frac{z}{t}}{t} + x \cdot x}{y}}{\color{blue}{y}} \]
  6. Applied rewrites66.0%

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

Reproduce

?
herbie shell --seed 2025093 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
  :precision binary64
  (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))