Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23

Percentage Accurate: 99.9% → 99.9%
Time: 6.0s
Alternatives: 6
Speedup: 1.0×

Specification

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

\\
\left(x \cdot y + z\right) \cdot y + 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 6 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: 99.9% accurate, 1.0× speedup?

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

\\
\left(x \cdot y + z\right) \cdot y + t
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

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

\\
t + \left(y \cdot x + z\right) \cdot y
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x \cdot y + z\right) \cdot y + t \]
  2. Add Preprocessing
  3. Final simplification99.9%

    \[\leadsto t + \left(y \cdot x + z\right) \cdot y \]
  4. Add Preprocessing

Alternative 2: 90.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y \cdot x + z\right) \cdot y\\ t_2 := \mathsf{fma}\left(y, x, z\right) \cdot y\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+153}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (+ (* y x) z) y)) (t_2 (* (fma y x z) y)))
   (if (<= t_1 -2e+153) t_2 (if (<= t_1 2e+49) (fma z y t) t_2))))
double code(double x, double y, double z, double t) {
	double t_1 = ((y * x) + z) * y;
	double t_2 = fma(y, x, z) * y;
	double tmp;
	if (t_1 <= -2e+153) {
		tmp = t_2;
	} else if (t_1 <= 2e+49) {
		tmp = fma(z, y, t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(y * x) + z) * y)
	t_2 = Float64(fma(y, x, z) * y)
	tmp = 0.0
	if (t_1 <= -2e+153)
		tmp = t_2;
	elseif (t_1 <= 2e+49)
		tmp = fma(z, y, t);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x + z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+153], t$95$2, If[LessEqual[t$95$1, 2e+49], N[(z * y + t), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(z, y, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 (*.f64 x y) z) y) < -2e153 or 1.99999999999999989e49 < (*.f64 (+.f64 (*.f64 x y) z) y)

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

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

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(x + \frac{z}{y}\right)\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto y \cdot \color{blue}{\left(x \cdot y + \frac{z}{y} \cdot y\right)} \]
      4. distribute-rgt-inN/A

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

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

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \color{blue}{\frac{z \cdot y}{y}} \]
      7. associate-/l*N/A

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \color{blue}{\left(z \cdot \frac{y}{y}\right)} \]
      8. *-inversesN/A

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \left(z \cdot \color{blue}{1}\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \color{blue}{z} \]
      10. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot y + \color{blue}{z \cdot y} \]
      11. distribute-rgt-inN/A

        \[\leadsto \color{blue}{y \cdot \left(x \cdot y + z\right)} \]
      12. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(z + x \cdot y\right)} \]
      13. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(z + x \cdot y\right) \cdot y} \]
      15. +-commutativeN/A

        \[\leadsto \color{blue}{\left(x \cdot y + z\right)} \cdot y \]
      16. *-commutativeN/A

        \[\leadsto \left(\color{blue}{y \cdot x} + z\right) \cdot y \]
      17. lower-fma.f6492.5

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

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

    if -2e153 < (*.f64 (+.f64 (*.f64 x y) z) y) < 1.99999999999999989e49

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{t + y \cdot z} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot y} + t \]
      3. lower-fma.f6487.7

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    5. Applied rewrites87.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y \cdot x + z\right) \cdot y \leq -2 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(y, x, z\right) \cdot y\\ \mathbf{elif}\;\left(y \cdot x + z\right) \cdot y \leq 2 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, z\right) \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(z, y, t\right)\\

\mathbf{elif}\;z \leq 4000000000000:\\
\;\;\;\;\mathsf{fma}\left(y \cdot x, y, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.7999999999999998e198 or 4e12 < z

    1. Initial program 100.0%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{t + y \cdot z} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot y} + t \]
      3. lower-fma.f6487.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    5. Applied rewrites87.9%

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

    if -8.7999999999999998e198 < z < 4e12

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{t + x \cdot {y}^{2}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot x}, y, t\right) \]
      6. lower-*.f6492.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot x}, y, t\right) \]
    5. Applied rewrites92.2%

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

Alternative 4: 79.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y \cdot x\right) \cdot y\\ \mathbf{if}\;y \leq -1.42 \cdot 10^{+107}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+134}:\\ \;\;\;\;\mathsf{fma}\left(z, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (* y x) y)))
   (if (<= y -1.42e+107) t_1 (if (<= y 2.2e+134) (fma z y t) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * x) * y;
	double tmp;
	if (y <= -1.42e+107) {
		tmp = t_1;
	} else if (y <= 2.2e+134) {
		tmp = fma(z, y, t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(y * x) * y)
	tmp = 0.0
	if (y <= -1.42e+107)
		tmp = t_1;
	elseif (y <= 2.2e+134)
		tmp = fma(z, y, t);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.42e+107], t$95$1, If[LessEqual[y, 2.2e+134], N[(z * y + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1.42 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(z, y, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.42000000000000006e107 or 2.2e134 < y

    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot x \]
      4. lower-*.f6475.4

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot x \]
    5. Applied rewrites75.4%

      \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot x} \]
    6. Step-by-step derivation
      1. Applied rewrites80.0%

        \[\leadsto \left(y \cdot x\right) \cdot \color{blue}{y} \]

      if -1.42000000000000006e107 < y < 2.2e134

      1. Initial program 99.9%

        \[\left(x \cdot y + z\right) \cdot y + t \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{t + y \cdot z} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto \color{blue}{z \cdot y} + t \]
        3. lower-fma.f6480.3

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
      5. Applied rewrites80.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, t\right)} \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 5: 65.9% accurate, 2.4× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(z, y, t\right) \end{array} \]
    (FPCore (x y z t) :precision binary64 (fma z y t))
    double code(double x, double y, double z, double t) {
    	return fma(z, y, t);
    }
    
    function code(x, y, z, t)
    	return fma(z, y, t)
    end
    
    code[x_, y_, z_, t_] := N[(z * y + t), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \mathsf{fma}\left(z, y, t\right)
    \end{array}
    
    Derivation
    1. Initial program 99.9%

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{t + y \cdot z} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{z \cdot y} + t \]
      3. lower-fma.f6467.4

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

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

    Alternative 6: 29.4% accurate, 2.8× speedup?

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

      \[\left(x \cdot y + z\right) \cdot y + t \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

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

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(x + \frac{z}{y}\right)\right)} \]
      3. distribute-rgt-inN/A

        \[\leadsto y \cdot \color{blue}{\left(x \cdot y + \frac{z}{y} \cdot y\right)} \]
      4. distribute-rgt-inN/A

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

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

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \color{blue}{\frac{z \cdot y}{y}} \]
      7. associate-/l*N/A

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \color{blue}{\left(z \cdot \frac{y}{y}\right)} \]
      8. *-inversesN/A

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \left(z \cdot \color{blue}{1}\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \left(x \cdot y\right) \cdot y + y \cdot \color{blue}{z} \]
      10. *-commutativeN/A

        \[\leadsto \left(x \cdot y\right) \cdot y + \color{blue}{z \cdot y} \]
      11. distribute-rgt-inN/A

        \[\leadsto \color{blue}{y \cdot \left(x \cdot y + z\right)} \]
      12. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(z + x \cdot y\right)} \]
      13. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(z + x \cdot y\right) \cdot y} \]
      15. +-commutativeN/A

        \[\leadsto \color{blue}{\left(x \cdot y + z\right)} \cdot y \]
      16. *-commutativeN/A

        \[\leadsto \left(\color{blue}{y \cdot x} + z\right) \cdot y \]
      17. lower-fma.f6462.5

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

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

      \[\leadsto \left(z \cdot \left(1 + \frac{x \cdot y}{z}\right)\right) \cdot y \]
    7. Step-by-step derivation
      1. Applied rewrites59.3%

        \[\leadsto \left(\mathsf{fma}\left(x, \frac{y}{z}, 1\right) \cdot z\right) \cdot y \]
      2. Taylor expanded in x around 0

        \[\leadsto y \cdot \color{blue}{z} \]
      3. Step-by-step derivation
        1. Applied rewrites31.6%

          \[\leadsto z \cdot \color{blue}{y} \]
        2. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024284 
        (FPCore (x y z t)
          :name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
          :precision binary64
          (+ (* (+ (* x y) z) y) t))