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

Percentage Accurate: 66.4% → 99.7%
Time: 16.1s
Alternatives: 8
Speedup: 1.0×

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 8 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.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: 99.7% accurate, 1.0× speedup?

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

\\
\frac{\frac{x}{y}}{\frac{y}{x}} + \frac{z}{t} \cdot \frac{z}{t}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
  2. Step-by-step derivation
    1. times-frac83.4%

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

    \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z}{t} \cdot \frac{z}{t}} \]
  4. Step-by-step derivation
    1. frac-times99.7%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  5. Applied egg-rr99.7%

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  6. Step-by-step derivation
    1. clear-num99.7%

      \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{1}{\frac{y}{x}}} + \frac{z}{t} \cdot \frac{z}{t} \]
    2. un-div-inv99.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}} + \frac{z}{t} \cdot \frac{z}{t} \]
  7. Applied egg-rr99.7%

    \[\leadsto \color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}} + \frac{z}{t} \cdot \frac{z}{t} \]
  8. Final simplification99.7%

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

Alternative 2: 73.5% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 76.2%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/83.4%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative83.4%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def83.4%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/76.2%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. frac-times98.5%

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

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
      6. frac-times98.5%

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. associate-/r*99.6%

        \[\leadsto \color{blue}{\frac{\frac{z \cdot z}{t}}{t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. associate-*l/94.0%

        \[\leadsto \frac{\frac{z \cdot z}{t}}{t} + \color{blue}{\frac{x \cdot \frac{x}{y}}{y}} \]
      9. frac-add79.8%

        \[\leadsto \color{blue}{\frac{\frac{z \cdot z}{t} \cdot y + t \cdot \left(x \cdot \frac{x}{y}\right)}{t \cdot y}} \]
      10. fma-def79.8%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z \cdot \frac{z}{t}, y, \color{blue}{\left(t \cdot x\right) \cdot \frac{x}{y}}\right)}{t \cdot y} \]
      2. *-commutative82.1%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{t \cdot {x}^{2}}{y}}}{y \cdot t} \]
    9. Step-by-step derivation
      1. unpow270.4%

        \[\leadsto \frac{\frac{t \cdot \color{blue}{\left(x \cdot x\right)}}{y}}{y \cdot t} \]
      2. associate-*r/70.6%

        \[\leadsto \frac{\color{blue}{t \cdot \frac{x \cdot x}{y}}}{y \cdot t} \]
      3. associate-*l/76.4%

        \[\leadsto \frac{t \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}}{y \cdot t} \]
    10. Simplified76.4%

      \[\leadsto \frac{\color{blue}{t \cdot \left(\frac{x}{y} \cdot x\right)}}{y \cdot t} \]
    11. Step-by-step derivation
      1. associate-/l*82.4%

        \[\leadsto \color{blue}{\frac{t}{\frac{y \cdot t}{\frac{x}{y} \cdot x}}} \]
      2. associate-/r/83.5%

        \[\leadsto \color{blue}{\frac{t}{y \cdot t} \cdot \left(\frac{x}{y} \cdot x\right)} \]
      3. associate-*l/75.3%

        \[\leadsto \frac{t}{y \cdot t} \cdot \color{blue}{\frac{x \cdot x}{y}} \]
    12. Applied egg-rr75.3%

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

    if 5.0000000000000001e-170 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 65.8%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/74.4%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative74.4%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def74.4%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/65.8%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. frac-times75.0%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
      4. frac-times99.7%

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
      6. frac-times75.0%

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. clear-num74.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. frac-times65.8%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
      9. associate-/l*74.4%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
      10. frac-add36.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
      11. *-un-lft-identity36.5%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      12. associate-/l*38.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      13. times-frac40.5%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      14. times-frac52.3%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
      15. associate-/l*60.4%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \color{blue}{\frac{y}{\frac{x}{y}}}} \]
    5. Applied egg-rr60.4%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
    6. Step-by-step derivation
      1. associate-/l*53.4%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      2. associate-*r/60.3%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      3. *-commutative60.3%

        \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      4. associate-*r/59.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      5. associate-/r/59.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      6. associate-*r/58.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
      7. associate-/r/58.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
      8. associate-/l*51.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
      9. associate-*r/58.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\left(y \cdot \frac{y}{x}\right)}} \]
    7. Simplified58.7%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
    8. Taylor expanded in y around inf 69.0%

      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
      2. unpow269.0%

        \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    10. Simplified69.0%

      \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
    11. Step-by-step derivation
      1. frac-times81.3%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
    12. Applied egg-rr81.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{t}{y \cdot t} \cdot \frac{x \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \end{array} \]

Alternative 3: 79.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 76.2%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/83.4%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative83.4%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def83.4%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/76.2%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. frac-times98.5%

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

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
      6. frac-times98.5%

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. associate-/r*99.6%

        \[\leadsto \color{blue}{\frac{\frac{z \cdot z}{t}}{t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. associate-*l/94.0%

        \[\leadsto \frac{\frac{z \cdot z}{t}}{t} + \color{blue}{\frac{x \cdot \frac{x}{y}}{y}} \]
      9. frac-add79.8%

        \[\leadsto \color{blue}{\frac{\frac{z \cdot z}{t} \cdot y + t \cdot \left(x \cdot \frac{x}{y}\right)}{t \cdot y}} \]
      10. fma-def79.8%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z \cdot \frac{z}{t}, y, \color{blue}{\left(t \cdot x\right) \cdot \frac{x}{y}}\right)}{t \cdot y} \]
      2. *-commutative82.1%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{t \cdot {x}^{2}}{y}}}{y \cdot t} \]
    9. Step-by-step derivation
      1. unpow270.4%

        \[\leadsto \frac{\frac{t \cdot \color{blue}{\left(x \cdot x\right)}}{y}}{y \cdot t} \]
      2. associate-*r/70.6%

        \[\leadsto \frac{\color{blue}{t \cdot \frac{x \cdot x}{y}}}{y \cdot t} \]
      3. associate-*l/76.4%

        \[\leadsto \frac{t \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}}{y \cdot t} \]
    10. Simplified76.4%

      \[\leadsto \frac{\color{blue}{t \cdot \left(\frac{x}{y} \cdot x\right)}}{y \cdot t} \]
    11. Step-by-step derivation
      1. associate-*r*77.6%

        \[\leadsto \frac{\color{blue}{\left(t \cdot \frac{x}{y}\right) \cdot x}}{y \cdot t} \]
      2. *-commutative77.6%

        \[\leadsto \frac{\left(t \cdot \frac{x}{y}\right) \cdot x}{\color{blue}{t \cdot y}} \]
      3. times-frac90.5%

        \[\leadsto \color{blue}{\frac{t \cdot \frac{x}{y}}{t} \cdot \frac{x}{y}} \]
      4. *-commutative90.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{y} \cdot t}}{t} \cdot \frac{x}{y} \]
    12. Applied egg-rr90.5%

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

    if 5.0000000000000001e-170 < (/.f64 (*.f64 z z) (*.f64 t t))

    1. Initial program 65.8%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/74.4%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative74.4%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def74.4%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/65.8%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. frac-times75.0%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
      4. frac-times99.7%

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
      6. frac-times75.0%

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. clear-num74.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. frac-times65.8%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
      9. associate-/l*74.4%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
      10. frac-add36.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
      11. *-un-lft-identity36.5%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      12. associate-/l*38.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      13. times-frac40.5%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      14. times-frac52.3%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
      15. associate-/l*60.4%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \color{blue}{\frac{y}{\frac{x}{y}}}} \]
    5. Applied egg-rr60.4%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
    6. Step-by-step derivation
      1. associate-/l*53.4%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      2. associate-*r/60.3%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      3. *-commutative60.3%

        \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      4. associate-*r/59.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      5. associate-/r/59.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      6. associate-*r/58.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
      7. associate-/r/58.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
      8. associate-/l*51.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
      9. associate-*r/58.7%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\left(y \cdot \frac{y}{x}\right)}} \]
    7. Simplified58.7%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
    8. Taylor expanded in y around inf 69.0%

      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow269.0%

        \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
      2. unpow269.0%

        \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    10. Simplified69.0%

      \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
    11. Step-by-step derivation
      1. frac-times81.3%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
    12. Applied egg-rr81.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{\frac{x}{y} \cdot t}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \end{array} \]

Alternative 4: 96.4% accurate, 1.0× speedup?

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

\\
\frac{z}{t} \cdot \frac{z}{t} + x \cdot \frac{\frac{x}{y}}{y}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
  2. Step-by-step derivation
    1. times-frac83.4%

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

    \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z}{t} \cdot \frac{z}{t}} \]
  4. Step-by-step derivation
    1. frac-times99.7%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  5. Applied egg-rr99.7%

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  6. Step-by-step derivation
    1. clear-num99.7%

      \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{1}{\frac{y}{x}}} + \frac{z}{t} \cdot \frac{z}{t} \]
    2. un-div-inv99.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{\frac{y}{x}}} + \frac{z}{t} \cdot \frac{z}{t} \]
  7. Applied egg-rr99.7%

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

    \[\leadsto \color{blue}{\frac{{x}^{2}}{{y}^{2}}} + \frac{z}{t} \cdot \frac{z}{t} \]
  9. Step-by-step derivation
    1. unpow283.4%

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

      \[\leadsto \frac{x \cdot x}{\color{blue}{y \cdot y}} + \frac{z}{t} \cdot \frac{z}{t} \]
    3. associate-*r/92.7%

      \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z}{t} \cdot \frac{z}{t} \]
    4. associate-/r*98.3%

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

    \[\leadsto \color{blue}{x \cdot \frac{\frac{x}{y}}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  11. Final simplification98.3%

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

Alternative 5: 99.6% accurate, 1.0× speedup?

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

\\
\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
  2. Step-by-step derivation
    1. times-frac83.4%

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

    \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y} + \frac{z}{t} \cdot \frac{z}{t}} \]
  4. Step-by-step derivation
    1. frac-times99.7%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  5. Applied egg-rr99.7%

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z}{t} \cdot \frac{z}{t} \]
  6. Final simplification99.7%

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

Alternative 6: 59.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.9 \cdot 10^{+94}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{1}{t \cdot t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x 2.9e+94) (* (/ z t) (/ z t)) (* z (* z (/ 1.0 (* t t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 2.9e+94) {
		tmp = (z / t) * (z / t);
	} else {
		tmp = z * (z * (1.0 / (t * t)));
	}
	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 <= 2.9d+94) then
        tmp = (z / t) * (z / t)
    else
        tmp = z * (z * (1.0d0 / (t * t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 2.9e+94) {
		tmp = (z / t) * (z / t);
	} else {
		tmp = z * (z * (1.0 / (t * t)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= 2.9e+94:
		tmp = (z / t) * (z / t)
	else:
		tmp = z * (z * (1.0 / (t * t)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= 2.9e+94)
		tmp = Float64(Float64(z / t) * Float64(z / t));
	else
		tmp = Float64(z * Float64(z * Float64(1.0 / Float64(t * t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= 2.9e+94)
		tmp = (z / t) * (z / t);
	else
		tmp = z * (z * (1.0 / (t * t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.9e+94], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(1.0 / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{+94}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.8999999999999998e94

    1. Initial program 71.8%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/79.7%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative79.7%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def79.7%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/71.8%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
      4. frac-times99.7%

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
      6. frac-times83.3%

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. clear-num83.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. frac-times71.8%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
      9. associate-/l*79.7%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
      10. frac-add27.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
      11. *-un-lft-identity27.8%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      12. associate-/l*29.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      13. times-frac30.6%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      14. times-frac39.7%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
      15. associate-/l*44.0%

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

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
    6. Step-by-step derivation
      1. associate-/l*39.6%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      2. associate-*r/43.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      3. *-commutative43.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      4. associate-*r/43.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      5. associate-/r/43.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      6. associate-*r/42.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
      7. associate-/r/42.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
      8. associate-/l*38.3%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
      9. associate-*r/42.6%

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

      \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
    8. Taylor expanded in y around inf 55.7%

      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow255.7%

        \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
      2. unpow255.7%

        \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    10. Simplified55.7%

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

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
    12. Applied egg-rr66.1%

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

    if 2.8999999999999998e94 < x

    1. Initial program 55.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/65.1%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative65.1%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def65.1%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/55.4%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. frac-times78.6%

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

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.6%

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

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. clear-num78.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. frac-times55.4%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
      9. associate-/l*65.0%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
      10. frac-add23.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
      11. *-un-lft-identity23.9%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      12. associate-/l*24.0%

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      13. times-frac26.4%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      14. times-frac48.0%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
      15. associate-/l*59.6%

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

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
    6. Step-by-step derivation
      1. associate-/l*52.8%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      2. associate-*r/59.5%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      3. *-commutative59.5%

        \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      4. associate-*r/57.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      5. associate-/r/57.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      6. associate-*r/54.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
      7. associate-/r/55.0%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
      8. associate-/l*45.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
      9. associate-*r/55.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\left(y \cdot \frac{y}{x}\right)}} \]
    7. Simplified55.1%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
    8. Taylor expanded in y around inf 32.6%

      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow232.6%

        \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
      2. unpow232.6%

        \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    10. Simplified32.6%

      \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
    11. Step-by-step derivation
      1. associate-/l*40.1%

        \[\leadsto \color{blue}{\frac{z}{\frac{t \cdot t}{z}}} \]
      2. div-inv40.1%

        \[\leadsto \color{blue}{z \cdot \frac{1}{\frac{t \cdot t}{z}}} \]
      3. associate-/l*33.5%

        \[\leadsto z \cdot \frac{1}{\color{blue}{\frac{t}{\frac{z}{t}}}} \]
    12. Applied egg-rr33.5%

      \[\leadsto \color{blue}{z \cdot \frac{1}{\frac{t}{\frac{z}{t}}}} \]
    13. Step-by-step derivation
      1. associate-/r/33.4%

        \[\leadsto z \cdot \frac{1}{\color{blue}{\frac{t}{z} \cdot t}} \]
      2. associate-*l/40.1%

        \[\leadsto z \cdot \frac{1}{\color{blue}{\frac{t \cdot t}{z}}} \]
      3. associate-/r/40.1%

        \[\leadsto z \cdot \color{blue}{\left(\frac{1}{t \cdot t} \cdot z\right)} \]
    14. Applied egg-rr40.1%

      \[\leadsto z \cdot \color{blue}{\left(\frac{1}{t \cdot t} \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.9 \cdot 10^{+94}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{1}{t \cdot t}\right)\\ \end{array} \]

Alternative 7: 59.4% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+93}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{z}{t \cdot t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x 5e+93) (* (/ z t) (/ z t)) (* z (/ z (* t t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 5e+93) {
		tmp = (z / t) * (z / t);
	} else {
		tmp = z * (z / (t * t));
	}
	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 <= 5d+93) then
        tmp = (z / t) * (z / t)
    else
        tmp = z * (z / (t * t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= 5e+93) {
		tmp = (z / t) * (z / t);
	} else {
		tmp = z * (z / (t * t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= 5e+93:
		tmp = (z / t) * (z / t)
	else:
		tmp = z * (z / (t * t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= 5e+93)
		tmp = Float64(Float64(z / t) * Float64(z / t));
	else
		tmp = Float64(z * Float64(z / Float64(t * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= 5e+93)
		tmp = (z / t) * (z / t);
	else
		tmp = z * (z / (t * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, 5e+93], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.0000000000000001e93

    1. Initial program 71.8%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/79.7%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative79.7%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def79.7%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/71.8%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
      4. frac-times99.7%

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
      6. frac-times83.3%

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. clear-num83.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. frac-times71.8%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
      9. associate-/l*79.7%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
      10. frac-add27.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
      11. *-un-lft-identity27.8%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      12. associate-/l*29.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      13. times-frac30.6%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      14. times-frac39.7%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
      15. associate-/l*44.0%

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

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
    6. Step-by-step derivation
      1. associate-/l*39.6%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      2. associate-*r/43.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      3. *-commutative43.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      4. associate-*r/43.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      5. associate-/r/43.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      6. associate-*r/42.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
      7. associate-/r/42.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
      8. associate-/l*38.3%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
      9. associate-*r/42.6%

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

      \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
    8. Taylor expanded in y around inf 55.7%

      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow255.7%

        \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
      2. unpow255.7%

        \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    10. Simplified55.7%

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

        \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
    12. Applied egg-rr66.1%

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

    if 5.0000000000000001e93 < x

    1. Initial program 55.4%

      \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
    2. Step-by-step derivation
      1. associate-*l/65.1%

        \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
      2. *-commutative65.1%

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. fma-def65.1%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
      2. associate-*r/55.4%

        \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
      3. frac-times78.6%

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

        \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
      5. +-commutative99.6%

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

        \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
      7. clear-num78.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
      8. frac-times55.4%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
      9. associate-/l*65.0%

        \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
      10. frac-add23.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
      11. *-un-lft-identity23.9%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      12. associate-/l*24.0%

        \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      13. times-frac26.4%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
      14. times-frac48.0%

        \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
      15. associate-/l*59.6%

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

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
    6. Step-by-step derivation
      1. associate-/l*52.8%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      2. associate-*r/59.5%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      3. *-commutative59.5%

        \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      4. associate-*r/57.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      5. associate-/r/57.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
      6. associate-*r/54.9%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
      7. associate-/r/55.0%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
      8. associate-/l*45.6%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
      9. associate-*r/55.1%

        \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\left(y \cdot \frac{y}{x}\right)}} \]
    7. Simplified55.1%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
    8. Taylor expanded in y around inf 32.6%

      \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
    9. Step-by-step derivation
      1. unpow232.6%

        \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
      2. unpow232.6%

        \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
    10. Simplified32.6%

      \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
    11. Step-by-step derivation
      1. associate-/l*40.1%

        \[\leadsto \color{blue}{\frac{z}{\frac{t \cdot t}{z}}} \]
      2. associate-/r/40.1%

        \[\leadsto \color{blue}{\frac{z}{t \cdot t} \cdot z} \]
    12. Applied egg-rr40.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+93}:\\ \;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{z}{t \cdot t}\\ \end{array} \]

Alternative 8: 58.9% accurate, 2.1× speedup?

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

\\
\frac{z}{t} \cdot \frac{z}{t}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t} \]
  2. Step-by-step derivation
    1. associate-*l/77.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y} \cdot x} + \frac{z \cdot z}{t \cdot t} \]
    2. *-commutative77.3%

      \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
    3. fma-def77.3%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}} \]
    2. associate-*r/69.1%

      \[\leadsto \color{blue}{\frac{x \cdot x}{y \cdot y}} + \frac{z \cdot z}{t \cdot t} \]
    3. frac-times82.5%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t} \]
    4. frac-times99.7%

      \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
    5. +-commutative99.7%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}} \]
    6. frac-times82.5%

      \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} + \frac{x}{y} \cdot \frac{x}{y} \]
    7. clear-num82.5%

      \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot t}{z \cdot z}}} + \frac{x}{y} \cdot \frac{x}{y} \]
    8. frac-times69.1%

      \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x \cdot x}{y \cdot y}} \]
    9. associate-/l*77.3%

      \[\leadsto \frac{1}{\frac{t \cdot t}{z \cdot z}} + \color{blue}{\frac{x}{\frac{y \cdot y}{x}}} \]
    10. frac-add27.2%

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{y \cdot y}{x} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}}} \]
    11. *-un-lft-identity27.2%

      \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
    12. associate-/l*28.8%

      \[\leadsto \frac{\color{blue}{\frac{y}{\frac{x}{y}}} + \frac{t \cdot t}{z \cdot z} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
    13. times-frac30.0%

      \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot x}{\frac{t \cdot t}{z \cdot z} \cdot \frac{y \cdot y}{x}} \]
    14. times-frac41.0%

      \[\leadsto \frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\color{blue}{\left(\frac{t}{z} \cdot \frac{t}{z}\right)} \cdot \frac{y \cdot y}{x}} \]
    15. associate-/l*46.5%

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

    \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x}{y}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}}} \]
  6. Step-by-step derivation
    1. associate-/l*41.8%

      \[\leadsto \frac{\color{blue}{\frac{y \cdot y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
    2. associate-*r/46.5%

      \[\leadsto \frac{\color{blue}{y \cdot \frac{y}{x}} + \left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot x}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
    3. *-commutative46.5%

      \[\leadsto \frac{y \cdot \frac{y}{x} + \color{blue}{x \cdot \left(\frac{t}{z} \cdot \frac{t}{z}\right)}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
    4. associate-*r/46.1%

      \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \color{blue}{\frac{\frac{t}{z} \cdot t}{z}}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
    5. associate-/r/46.1%

      \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z}}{\left(\frac{t}{z} \cdot \frac{t}{z}\right) \cdot \frac{y}{\frac{x}{y}}} \]
    6. associate-*r/44.6%

      \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\color{blue}{\frac{\frac{t}{z} \cdot t}{z}} \cdot \frac{y}{\frac{x}{y}}} \]
    7. associate-/r/44.6%

      \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\color{blue}{\frac{t}{\frac{z}{t}}}}{z} \cdot \frac{y}{\frac{x}{y}}} \]
    8. associate-/l*39.5%

      \[\leadsto \frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \color{blue}{\frac{y \cdot y}{x}}} \]
    9. associate-*r/44.6%

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

    \[\leadsto \color{blue}{\frac{y \cdot \frac{y}{x} + x \cdot \frac{\frac{t}{\frac{z}{t}}}{z}}{\frac{\frac{t}{\frac{z}{t}}}{z} \cdot \left(y \cdot \frac{y}{x}\right)}} \]
  8. Taylor expanded in y around inf 51.9%

    \[\leadsto \color{blue}{\frac{{z}^{2}}{{t}^{2}}} \]
  9. Step-by-step derivation
    1. unpow251.9%

      \[\leadsto \frac{\color{blue}{z \cdot z}}{{t}^{2}} \]
    2. unpow251.9%

      \[\leadsto \frac{z \cdot z}{\color{blue}{t \cdot t}} \]
  10. Simplified51.9%

    \[\leadsto \color{blue}{\frac{z \cdot z}{t \cdot t}} \]
  11. Step-by-step derivation
    1. frac-times60.7%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
  12. Applied egg-rr60.7%

    \[\leadsto \color{blue}{\frac{z}{t} \cdot \frac{z}{t}} \]
  13. Final simplification60.7%

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

Developer target: 99.6% accurate, 0.1× 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 2023279 
(FPCore (x y z t)
  :name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
  :precision binary64

  :herbie-target
  (+ (pow (/ x y) 2.0) (pow (/ z t) 2.0))

  (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))