Average Error: 0.1 → 0.2
Time: 1.6m
Precision: 64
Internal Precision: 384
\[\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) \cdot \left(1 + \left(\sqrt{\frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}}} \cdot \sqrt{\frac{1}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}}}\right) \cdot rand\right)\]

Error

Bits error versus a

Bits error versus rand

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 add-sqr-sqrt0.2

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

Runtime

Time bar (total: 1.6m)Debug logProfile

herbie shell --seed '#(1063185673 2139736501 2393378123 1907444849 1070993796 1007244912)' 
(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))))