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

Percentage Accurate: 65.9% → 98.0%
Time: 10.8s
Alternatives: 11
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 65.9% 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: 98.0% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e290 < (*.f64 z z)

    1. Initial program 51.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{y} \cdot x\right) \cdot \frac{x}{y}\\


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

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 76.6%

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{y} \cdot \left(\frac{1}{y} \cdot \color{blue}{x}\right) \]
          3. Recombined 3 regimes into one program.
          4. Final simplification80.8%

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

          Developer Target 1: 99.6% accurate, 0.2× speedup?

          \[\begin{array}{l} \\ {\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2} \end{array} \]
          (FPCore (x y z t) :precision binary64 (+ (pow (/ x y) 2.0) (pow (/ z t) 2.0)))
          double code(double x, double y, double z, double t) {
          	return pow((x / y), 2.0) + pow((z / t), 2.0);
          }
          
          real(8) function code(x, y, z, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              code = ((x / y) ** 2.0d0) + ((z / t) ** 2.0d0)
          end function
          
          public static double code(double x, double y, double z, double t) {
          	return Math.pow((x / y), 2.0) + Math.pow((z / t), 2.0);
          }
          
          def code(x, y, z, t):
          	return math.pow((x / y), 2.0) + math.pow((z / t), 2.0)
          
          function code(x, y, z, t)
          	return Float64((Float64(x / y) ^ 2.0) + (Float64(z / t) ^ 2.0))
          end
          
          function tmp = code(x, y, z, t)
          	tmp = ((x / y) ^ 2.0) + ((z / t) ^ 2.0);
          end
          
          code[x_, y_, z_, t_] := N[(N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          {\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}
          \end{array}
          

          Reproduce

          ?
          herbie shell --seed 2024230 
          (FPCore (x y z t)
            :name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
            :precision binary64
          
            :alt
            (! :herbie-platform default (+ (pow (/ x y) 2) (pow (/ z t) 2)))
          
            (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))