Numeric.LinearAlgebra.Util:formatSparse from hmatrix-0.16.1.5

Percentage Accurate: 100.0% → 100.0%
Time: 3.2s
Alternatives: 5
Speedup: 2.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left|x - y\right|}{\left|y\right|} \end{array} \]
(FPCore (x y) :precision binary64 (/ (fabs (- x y)) (fabs y)))
double code(double x, double y) {
	return fabs((x - y)) / fabs(y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = abs((x - y)) / abs(y)
end function
public static double code(double x, double y) {
	return Math.abs((x - y)) / Math.abs(y);
}
def code(x, y):
	return math.fabs((x - y)) / math.fabs(y)
function code(x, y)
	return Float64(abs(Float64(x - y)) / abs(y))
end
function tmp = code(x, y)
	tmp = abs((x - y)) / abs(y);
end
code[x_, y_] := N[(N[Abs[N[(x - y), $MachinePrecision]], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left|x - y\right|}{\left|y\right|}
\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 5 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: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left|x - y\right|}{\left|y\right|} \end{array} \]
(FPCore (x y) :precision binary64 (/ (fabs (- x y)) (fabs y)))
double code(double x, double y) {
	return fabs((x - y)) / fabs(y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = abs((x - y)) / abs(y)
end function
public static double code(double x, double y) {
	return Math.abs((x - y)) / Math.abs(y);
}
def code(x, y):
	return math.fabs((x - y)) / math.fabs(y)
function code(x, y)
	return Float64(abs(Float64(x - y)) / abs(y))
end
function tmp = code(x, y)
	tmp = abs((x - y)) / abs(y);
end
code[x_, y_] := N[(N[Abs[N[(x - y), $MachinePrecision]], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left|x - y\right|}{\left|y\right|}
\end{array}

Alternative 1: 100.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \left|\frac{x}{y} + -1\right| \end{array} \]
(FPCore (x y) :precision binary64 (fabs (+ (/ x y) -1.0)))
double code(double x, double y) {
	return fabs(((x / y) + -1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = abs(((x / y) + (-1.0d0)))
end function
public static double code(double x, double y) {
	return Math.abs(((x / y) + -1.0));
}
def code(x, y):
	return math.fabs(((x / y) + -1.0))
function code(x, y)
	return abs(Float64(Float64(x / y) + -1.0))
end
function tmp = code(x, y)
	tmp = abs(((x / y) + -1.0));
end
code[x_, y_] := N[Abs[N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\frac{x}{y} + -1\right|
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{\left|x - y\right|}{\left|y\right|} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. div-fabs100.0%

      \[\leadsto \color{blue}{\left|\frac{x - y}{y}\right|} \]
    2. div-sub100.0%

      \[\leadsto \left|\color{blue}{\frac{x}{y} - \frac{y}{y}}\right| \]
    3. pow1100.0%

      \[\leadsto \left|\frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y}\right| \]
    4. pow1100.0%

      \[\leadsto \left|\frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}}\right| \]
    5. pow-div100.0%

      \[\leadsto \left|\frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}}\right| \]
    6. metadata-eval100.0%

      \[\leadsto \left|\frac{x}{y} - {y}^{\color{blue}{0}}\right| \]
    7. metadata-eval100.0%

      \[\leadsto \left|\frac{x}{y} - \color{blue}{1}\right| \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\left|\frac{x}{y} - 1\right|} \]
  5. Final simplification100.0%

    \[\leadsto \left|\frac{x}{y} + -1\right| \]
  6. Add Preprocessing

Alternative 2: 76.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-7} \lor \neg \left(x \leq 66000000000\right):\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x -8e-7) (not (<= x 66000000000.0))) (fabs (/ x y)) 1.0))
double code(double x, double y) {
	double tmp;
	if ((x <= -8e-7) || !(x <= 66000000000.0)) {
		tmp = fabs((x / y));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= (-8d-7)) .or. (.not. (x <= 66000000000.0d0))) then
        tmp = abs((x / y))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= -8e-7) || !(x <= 66000000000.0)) {
		tmp = Math.abs((x / y));
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= -8e-7) or not (x <= 66000000000.0):
		tmp = math.fabs((x / y))
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= -8e-7) || !(x <= 66000000000.0))
		tmp = abs(Float64(x / y));
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= -8e-7) || ~((x <= 66000000000.0)))
		tmp = abs((x / y));
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, -8e-7], N[Not[LessEqual[x, 66000000000.0]], $MachinePrecision]], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision], 1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-7} \lor \neg \left(x \leq 66000000000\right):\\
\;\;\;\;\left|\frac{x}{y}\right|\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.9999999999999996e-7 or 6.6e10 < x

    1. Initial program 100.0%

      \[\frac{\left|x - y\right|}{\left|y\right|} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-fabs100.0%

        \[\leadsto \color{blue}{\left|\frac{x - y}{y}\right|} \]
      2. div-sub100.0%

        \[\leadsto \left|\color{blue}{\frac{x}{y} - \frac{y}{y}}\right| \]
      3. pow1100.0%

        \[\leadsto \left|\frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y}\right| \]
      4. pow1100.0%

        \[\leadsto \left|\frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}}\right| \]
      5. pow-div100.0%

        \[\leadsto \left|\frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}}\right| \]
      6. metadata-eval100.0%

        \[\leadsto \left|\frac{x}{y} - {y}^{\color{blue}{0}}\right| \]
      7. metadata-eval100.0%

        \[\leadsto \left|\frac{x}{y} - \color{blue}{1}\right| \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left|\frac{x}{y} - 1\right|} \]
    5. Taylor expanded in x around inf 83.6%

      \[\leadsto \left|\color{blue}{\frac{x}{y}}\right| \]

    if -7.9999999999999996e-7 < x < 6.6e10

    1. Initial program 100.0%

      \[\frac{\left|x - y\right|}{\left|y\right|} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-fabs100.0%

        \[\leadsto \color{blue}{\left|\frac{x - y}{y}\right|} \]
      2. div-sub100.0%

        \[\leadsto \left|\color{blue}{\frac{x}{y} - \frac{y}{y}}\right| \]
      3. pow1100.0%

        \[\leadsto \left|\frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y}\right| \]
      4. pow1100.0%

        \[\leadsto \left|\frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}}\right| \]
      5. pow-div100.0%

        \[\leadsto \left|\frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}}\right| \]
      6. metadata-eval100.0%

        \[\leadsto \left|\frac{x}{y} - {y}^{\color{blue}{0}}\right| \]
      7. metadata-eval100.0%

        \[\leadsto \left|\frac{x}{y} - \color{blue}{1}\right| \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left|\frac{x}{y} - 1\right|} \]
    5. Taylor expanded in x around 0 81.3%

      \[\leadsto \left|\color{blue}{-1}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-7} \lor \neg \left(x \leq 66000000000\right):\\ \;\;\;\;\left|\frac{x}{y}\right|\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 58.2% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{+103} \lor \neg \left(x \leq 3 \cdot 10^{+14}\right) \land \left(x \leq 1.5 \cdot 10^{+44} \lor \neg \left(x \leq 1.8 \cdot 10^{+171}\right)\right):\\ \;\;\;\;\frac{x}{y} + -1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x -3.8e+103)
         (and (not (<= x 3e+14)) (or (<= x 1.5e+44) (not (<= x 1.8e+171)))))
   (+ (/ x y) -1.0)
   1.0))
double code(double x, double y) {
	double tmp;
	if ((x <= -3.8e+103) || (!(x <= 3e+14) && ((x <= 1.5e+44) || !(x <= 1.8e+171)))) {
		tmp = (x / y) + -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= (-3.8d+103)) .or. (.not. (x <= 3d+14)) .and. (x <= 1.5d+44) .or. (.not. (x <= 1.8d+171))) then
        tmp = (x / y) + (-1.0d0)
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= -3.8e+103) || (!(x <= 3e+14) && ((x <= 1.5e+44) || !(x <= 1.8e+171)))) {
		tmp = (x / y) + -1.0;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= -3.8e+103) or (not (x <= 3e+14) and ((x <= 1.5e+44) or not (x <= 1.8e+171))):
		tmp = (x / y) + -1.0
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= -3.8e+103) || (!(x <= 3e+14) && ((x <= 1.5e+44) || !(x <= 1.8e+171))))
		tmp = Float64(Float64(x / y) + -1.0);
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= -3.8e+103) || (~((x <= 3e+14)) && ((x <= 1.5e+44) || ~((x <= 1.8e+171)))))
		tmp = (x / y) + -1.0;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, -3.8e+103], And[N[Not[LessEqual[x, 3e+14]], $MachinePrecision], Or[LessEqual[x, 1.5e+44], N[Not[LessEqual[x, 1.8e+171]], $MachinePrecision]]]], N[(N[(x / y), $MachinePrecision] + -1.0), $MachinePrecision], 1.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+103} \lor \neg \left(x \leq 3 \cdot 10^{+14}\right) \land \left(x \leq 1.5 \cdot 10^{+44} \lor \neg \left(x \leq 1.8 \cdot 10^{+171}\right)\right):\\
\;\;\;\;\frac{x}{y} + -1\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7999999999999997e103 or 3e14 < x < 1.49999999999999993e44 or 1.80000000000000009e171 < x

    1. Initial program 100.0%

      \[\frac{\left|x - y\right|}{\left|y\right|} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt47.0%

        \[\leadsto \frac{\left|\color{blue}{\sqrt{x - y} \cdot \sqrt{x - y}}\right|}{\left|y\right|} \]
      2. fabs-sqr47.0%

        \[\leadsto \frac{\color{blue}{\sqrt{x - y} \cdot \sqrt{x - y}}}{\left|y\right|} \]
      3. add-sqr-sqrt29.7%

        \[\leadsto \frac{\sqrt{x - y} \cdot \sqrt{x - y}}{\left|\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right|} \]
      4. fabs-sqr29.7%

        \[\leadsto \frac{\sqrt{x - y} \cdot \sqrt{x - y}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      5. add-sqr-sqrt30.0%

        \[\leadsto \frac{\color{blue}{x - y}}{\sqrt{y} \cdot \sqrt{y}} \]
      6. add-sqr-sqrt51.7%

        \[\leadsto \frac{x - y}{\color{blue}{y}} \]
      7. div-sub51.7%

        \[\leadsto \color{blue}{\frac{x}{y} - \frac{y}{y}} \]
      8. pow151.7%

        \[\leadsto \frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y} \]
      9. pow151.7%

        \[\leadsto \frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}} \]
      10. pow-div51.7%

        \[\leadsto \frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}} \]
      11. metadata-eval51.7%

        \[\leadsto \frac{x}{y} - {y}^{\color{blue}{0}} \]
      12. metadata-eval51.7%

        \[\leadsto \frac{x}{y} - \color{blue}{1} \]
    4. Applied egg-rr51.7%

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

    if -3.7999999999999997e103 < x < 3e14 or 1.49999999999999993e44 < x < 1.80000000000000009e171

    1. Initial program 100.0%

      \[\frac{\left|x - y\right|}{\left|y\right|} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-fabs100.0%

        \[\leadsto \color{blue}{\left|\frac{x - y}{y}\right|} \]
      2. div-sub100.0%

        \[\leadsto \left|\color{blue}{\frac{x}{y} - \frac{y}{y}}\right| \]
      3. pow1100.0%

        \[\leadsto \left|\frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y}\right| \]
      4. pow1100.0%

        \[\leadsto \left|\frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}}\right| \]
      5. pow-div100.0%

        \[\leadsto \left|\frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}}\right| \]
      6. metadata-eval100.0%

        \[\leadsto \left|\frac{x}{y} - {y}^{\color{blue}{0}}\right| \]
      7. metadata-eval100.0%

        \[\leadsto \left|\frac{x}{y} - \color{blue}{1}\right| \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left|\frac{x}{y} - 1\right|} \]
    5. Taylor expanded in x around 0 72.5%

      \[\leadsto \left|\color{blue}{-1}\right| \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{+103} \lor \neg \left(x \leq 3 \cdot 10^{+14}\right) \land \left(x \leq 1.5 \cdot 10^{+44} \lor \neg \left(x \leq 1.8 \cdot 10^{+171}\right)\right):\\ \;\;\;\;\frac{x}{y} + -1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 25.7% accurate, 68.3× speedup?

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

\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{\left|x - y\right|}{\left|y\right|} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt45.1%

      \[\leadsto \frac{\left|\color{blue}{\sqrt{x - y} \cdot \sqrt{x - y}}\right|}{\left|y\right|} \]
    2. fabs-sqr45.1%

      \[\leadsto \frac{\color{blue}{\sqrt{x - y} \cdot \sqrt{x - y}}}{\left|y\right|} \]
    3. add-sqr-sqrt11.6%

      \[\leadsto \frac{\sqrt{x - y} \cdot \sqrt{x - y}}{\left|\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right|} \]
    4. fabs-sqr11.6%

      \[\leadsto \frac{\sqrt{x - y} \cdot \sqrt{x - y}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
    5. add-sqr-sqrt12.2%

      \[\leadsto \frac{\color{blue}{x - y}}{\sqrt{y} \cdot \sqrt{y}} \]
    6. add-sqr-sqrt24.0%

      \[\leadsto \frac{x - y}{\color{blue}{y}} \]
    7. div-sub24.0%

      \[\leadsto \color{blue}{\frac{x}{y} - \frac{y}{y}} \]
    8. pow124.0%

      \[\leadsto \frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y} \]
    9. pow124.0%

      \[\leadsto \frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}} \]
    10. pow-div24.0%

      \[\leadsto \frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}} \]
    11. metadata-eval24.0%

      \[\leadsto \frac{x}{y} - {y}^{\color{blue}{0}} \]
    12. metadata-eval24.0%

      \[\leadsto \frac{x}{y} - \color{blue}{1} \]
  4. Applied egg-rr24.0%

    \[\leadsto \color{blue}{\frac{x}{y} - 1} \]
  5. Taylor expanded in x around inf 24.4%

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  6. Final simplification24.4%

    \[\leadsto \frac{x}{y} \]
  7. Add Preprocessing

Alternative 5: 1.3% accurate, 205.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (x y) :precision binary64 -1.0)
double code(double x, double y) {
	return -1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = -1.0d0
end function
public static double code(double x, double y) {
	return -1.0;
}
def code(x, y):
	return -1.0
function code(x, y)
	return -1.0
end
function tmp = code(x, y)
	tmp = -1.0;
end
code[x_, y_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{\left|x - y\right|}{\left|y\right|} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt45.1%

      \[\leadsto \frac{\left|\color{blue}{\sqrt{x - y} \cdot \sqrt{x - y}}\right|}{\left|y\right|} \]
    2. fabs-sqr45.1%

      \[\leadsto \frac{\color{blue}{\sqrt{x - y} \cdot \sqrt{x - y}}}{\left|y\right|} \]
    3. add-sqr-sqrt11.6%

      \[\leadsto \frac{\sqrt{x - y} \cdot \sqrt{x - y}}{\left|\color{blue}{\sqrt{y} \cdot \sqrt{y}}\right|} \]
    4. fabs-sqr11.6%

      \[\leadsto \frac{\sqrt{x - y} \cdot \sqrt{x - y}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
    5. add-sqr-sqrt12.2%

      \[\leadsto \frac{\color{blue}{x - y}}{\sqrt{y} \cdot \sqrt{y}} \]
    6. add-sqr-sqrt24.0%

      \[\leadsto \frac{x - y}{\color{blue}{y}} \]
    7. div-sub24.0%

      \[\leadsto \color{blue}{\frac{x}{y} - \frac{y}{y}} \]
    8. pow124.0%

      \[\leadsto \frac{x}{y} - \frac{\color{blue}{{y}^{1}}}{y} \]
    9. pow124.0%

      \[\leadsto \frac{x}{y} - \frac{{y}^{1}}{\color{blue}{{y}^{1}}} \]
    10. pow-div24.0%

      \[\leadsto \frac{x}{y} - \color{blue}{{y}^{\left(1 - 1\right)}} \]
    11. metadata-eval24.0%

      \[\leadsto \frac{x}{y} - {y}^{\color{blue}{0}} \]
    12. metadata-eval24.0%

      \[\leadsto \frac{x}{y} - \color{blue}{1} \]
  4. Applied egg-rr24.0%

    \[\leadsto \color{blue}{\frac{x}{y} - 1} \]
  5. Taylor expanded in x around 0 1.3%

    \[\leadsto \color{blue}{-1} \]
  6. Final simplification1.3%

    \[\leadsto -1 \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024017 
(FPCore (x y)
  :name "Numeric.LinearAlgebra.Util:formatSparse from hmatrix-0.16.1.5"
  :precision binary64
  (/ (fabs (- x y)) (fabs y)))