Average Error: 0.1 → 0.1
Time: 1.6m
Precision: 64
Internal Precision: 576
\[\left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}} \cdot rand\right)\]
\[\left(a - \frac{1.0}{3.0}\right) + \left(\left(a - \frac{1.0}{3.0}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}}\right) \cdot rand\]

Error

Bits error versus a

Bits error versus rand

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Derivation

  1. Initial program 0.1

    \[\left(a - \frac{1.0}{3.0}\right) \cdot \left(1 + \frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}} \cdot rand\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.1

    \[\leadsto \color{blue}{\left(a - \frac{1.0}{3.0}\right) \cdot 1 + \left(a - \frac{1.0}{3.0}\right) \cdot \left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}} \cdot rand\right)}\]
  4. Applied simplify0.1

    \[\leadsto \color{blue}{\left(a - \frac{1.0}{3.0}\right)} + \left(a - \frac{1.0}{3.0}\right) \cdot \left(\frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}} \cdot rand\right)\]
  5. Using strategy rm
  6. Applied associate-*r*0.1

    \[\leadsto \left(a - \frac{1.0}{3.0}\right) + \color{blue}{\left(\left(a - \frac{1.0}{3.0}\right) \cdot \frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}}\right) \cdot rand}\]

Runtime

Time bar (total: 1.6m)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +o rules:numerics
(FPCore (a rand)
  :name "Octave 3.8, oct_fill_randg"
  (* (- a (/ 1.0 3.0)) (+ 1 (* (/ 1 (sqrt (* 9 (- a (/ 1.0 3.0))))) rand))))