Average Error: 0.2 → 0.1
Time: 12.3s
Precision: 64
Internal precision: 128
\[3.0 \cdot \left(\left(\left(x \cdot 3.0\right) \cdot x - x \cdot 4.0\right) + 1.0\right)\]
\[\left(9.0 \cdot {x}^2 + 3.0\right) - 12.0 \cdot x\]

Error

Bits error versus x

Target

Original0.2
Comparison0.1
Herbie0.1
\[ 3.0 + \left(\left(9.0 \cdot x\right) \cdot x - 12.0 \cdot x\right) \]

Derivation

  1. Initial program 0.2

    \[3.0 \cdot \left(\left(\left(x \cdot 3.0\right) \cdot x - x \cdot 4.0\right) + 1.0\right)\]
  2. Applied taylor 0.1

    \[\leadsto \left(9.0 \cdot {x}^2 + 3.0\right) - 12.0 \cdot x\]
  3. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{\left(9.0 \cdot {x}^2 + 3.0\right) - 12.0 \cdot x}\]
  4. Removed slow pow expressions

Runtime

Time bar (total: 12.3s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(175151894 3086234271 441165424 3547039226 2272128932 975838262)'
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, D"

  :target
  (+ 3.0 (- (* (* 9.0 x) x) (* 12.0 x)))

  (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))