Average Error: 0.3 → 0.2
Time: 23.4s
Precision: 64
Internal Precision: 1408
\[\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x\]
\[\left(6.0 - 9.0 \cdot x\right) \cdot x\]

Error

Bits error versus x

Target

Original0.3
Target0.2
Herbie0.2
\[6.0 \cdot x - 9.0 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.3

    \[\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{6.0 \cdot x - 9.0 \cdot {x}^{2}}\]
  3. Applied simplify0.2

    \[\leadsto \color{blue}{\left(6.0 - 9.0 \cdot x\right) \cdot x}\]
  4. Removed slow pow expressions.

Runtime

Time bar (total: 23.4s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"

  :herbie-target
  (- (* 6.0 x) (* 9.0 (* x x)))

  (* (* 3.0 (- 2.0 (* x 3.0))) x))