Average Error: 0.3 → 0.3
Time: 1.7s
Precision: binary64
\[[x, y] = \mathsf{sort}([x, y]) \\]
\[\left(x \cdot 27\right) \cdot y \]
\[y \cdot \left(27 \cdot x\right) \]
(FPCore (x y) :precision binary64 (* (* x 27.0) y))
(FPCore (x y) :precision binary64 (* y (* 27.0 x)))
double code(double x, double y) {
	return (x * 27.0) * y;
}
double code(double x, double y) {
	return y * (27.0 * x);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * 27.0d0) * y
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = y * (27.0d0 * x)
end function
public static double code(double x, double y) {
	return (x * 27.0) * y;
}
public static double code(double x, double y) {
	return y * (27.0 * x);
}
def code(x, y):
	return (x * 27.0) * y
def code(x, y):
	return y * (27.0 * x)
function code(x, y)
	return Float64(Float64(x * 27.0) * y)
end
function code(x, y)
	return Float64(y * Float64(27.0 * x))
end
function tmp = code(x, y)
	tmp = (x * 27.0) * y;
end
function tmp = code(x, y)
	tmp = y * (27.0 * x);
end
code[x_, y_] := N[(N[(x * 27.0), $MachinePrecision] * y), $MachinePrecision]
code[x_, y_] := N[(y * N[(27.0 * x), $MachinePrecision]), $MachinePrecision]
\left(x \cdot 27\right) \cdot y
y \cdot \left(27 \cdot x\right)

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\left(x \cdot 27\right) \cdot y \]
  2. Taylor expanded in x around 0 0.3

    \[\leadsto \color{blue}{27 \cdot \left(y \cdot x\right)} \]
  3. Applied add-sqr-sqrt_binary640.3

    \[\leadsto \color{blue}{\left(\sqrt{27} \cdot \sqrt{27}\right)} \cdot \left(y \cdot x\right) \]
  4. Applied associate-*l*_binary640.4

    \[\leadsto \color{blue}{\sqrt{27} \cdot \left(\sqrt{27} \cdot \left(y \cdot x\right)\right)} \]
  5. Applied *-commutative_binary640.4

    \[\leadsto \color{blue}{\left(\sqrt{27} \cdot \left(y \cdot x\right)\right) \cdot \sqrt{27}} \]
  6. Applied pow1_binary640.4

    \[\leadsto \left(\sqrt{27} \cdot \left(y \cdot x\right)\right) \cdot \color{blue}{{\left(\sqrt{27}\right)}^{1}} \]
  7. Applied pow1_binary640.4

    \[\leadsto \left(\sqrt{27} \cdot \left(y \cdot \color{blue}{{x}^{1}}\right)\right) \cdot {\left(\sqrt{27}\right)}^{1} \]
  8. Applied pow1_binary640.4

    \[\leadsto \left(\sqrt{27} \cdot \left(\color{blue}{{y}^{1}} \cdot {x}^{1}\right)\right) \cdot {\left(\sqrt{27}\right)}^{1} \]
  9. Applied pow-prod-down_binary640.4

    \[\leadsto \left(\sqrt{27} \cdot \color{blue}{{\left(y \cdot x\right)}^{1}}\right) \cdot {\left(\sqrt{27}\right)}^{1} \]
  10. Applied pow1_binary640.4

    \[\leadsto \left(\color{blue}{{\left(\sqrt{27}\right)}^{1}} \cdot {\left(y \cdot x\right)}^{1}\right) \cdot {\left(\sqrt{27}\right)}^{1} \]
  11. Applied pow-prod-down_binary640.4

    \[\leadsto \color{blue}{{\left(\sqrt{27} \cdot \left(y \cdot x\right)\right)}^{1}} \cdot {\left(\sqrt{27}\right)}^{1} \]
  12. Applied pow-prod-down_binary640.4

    \[\leadsto \color{blue}{{\left(\left(\sqrt{27} \cdot \left(y \cdot x\right)\right) \cdot \sqrt{27}\right)}^{1}} \]
  13. Simplified0.3

    \[\leadsto {\color{blue}{\left(y \cdot \left(27 \cdot x\right)\right)}}^{1} \]
  14. Final simplification0.3

    \[\leadsto y \cdot \left(27 \cdot x\right) \]

Reproduce

herbie shell --seed 2022131 
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, F"
  :precision binary64
  (* (* x 27.0) y))