?

Average Accuracy: 52.0% → 99.4%
Time: 5.3s
Precision: binary64
Cost: 320

?

\[-0.01 \leq x \land x \leq 0.01\]
\[1 - \cos x \]
\[x \cdot \left(x \cdot 0.5\right) \]
(FPCore (x) :precision binary64 (- 1.0 (cos x)))
(FPCore (x) :precision binary64 (* x (* x 0.5)))
double code(double x) {
	return 1.0 - cos(x);
}
double code(double x) {
	return x * (x * 0.5);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 1.0d0 - cos(x)
end function
real(8) function code(x)
    real(8), intent (in) :: x
    code = x * (x * 0.5d0)
end function
public static double code(double x) {
	return 1.0 - Math.cos(x);
}
public static double code(double x) {
	return x * (x * 0.5);
}
def code(x):
	return 1.0 - math.cos(x)
def code(x):
	return x * (x * 0.5)
function code(x)
	return Float64(1.0 - cos(x))
end
function code(x)
	return Float64(x * Float64(x * 0.5))
end
function tmp = code(x)
	tmp = 1.0 - cos(x);
end
function tmp = code(x)
	tmp = x * (x * 0.5);
end
code[x_] := N[(1.0 - N[Cos[x], $MachinePrecision]), $MachinePrecision]
code[x_] := N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]
1 - \cos x
x \cdot \left(x \cdot 0.5\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original52.0%
Target100.0%
Herbie99.4%
\[\frac{\sin x \cdot \sin x}{1 + \cos x} \]

Derivation?

  1. Initial program 52.0%

    \[1 - \cos x \]
  2. Taylor expanded in x around 0 99.4%

    \[\leadsto \color{blue}{0.5 \cdot {x}^{2}} \]
  3. Simplified99.4%

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

    [Start]99.4

    \[ 0.5 \cdot {x}^{2} \]

    unpow2 [=>]99.4

    \[ 0.5 \cdot \color{blue}{\left(x \cdot x\right)} \]
  4. Taylor expanded in x around 0 99.4%

    \[\leadsto \color{blue}{0.5 \cdot {x}^{2}} \]
  5. Simplified99.4%

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

    [Start]99.4

    \[ 0.5 \cdot {x}^{2} \]

    unpow2 [=>]99.4

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

    associate-*r* [=>]99.4

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

    *-commutative [=>]99.4

    \[ \color{blue}{x \cdot \left(0.5 \cdot x\right)} \]
  6. Final simplification99.4%

    \[\leadsto x \cdot \left(x \cdot 0.5\right) \]

Alternatives

Alternative 1
Accuracy99.4%
Cost320
\[0.5 \cdot \left(x \cdot x\right) \]

Error

Reproduce?

herbie shell --seed 2023137 
(FPCore (x)
  :name "ENA, Section 1.4, Mentioned, A"
  :precision binary64
  :pre (and (<= -0.01 x) (<= x 0.01))

  :herbie-target
  (/ (* (sin x) (sin x)) (+ 1.0 (cos x)))

  (- 1.0 (cos x)))