Average Error: 5.9 → 0.1
Time: 28.9s
Precision: 64
Internal Precision: 384
\[x + \frac{y \cdot y}{z}\]
\[x + \frac{y}{\frac{z}{y}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original5.9
Target0.1
Herbie0.1
\[x + y \cdot \frac{y}{z}\]

Derivation

  1. Initial program 5.9

    \[x + \frac{y \cdot y}{z}\]
  2. Using strategy rm
  3. Applied associate-/l*0.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{y}}}\]
  4. Removed slow pow expressions.

Runtime

Time bar (total: 28.9s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z)
  :name "Crypto.Random.Test:calculate from crypto-random-0.0.9"

  :herbie-target
  (+ x (* y (/ y z)))

  (+ x (/ (* y y) z)))