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

Error

Bits error versus a

Bits error versus rand

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Initial simplification0.1

    \[\leadsto (rand \cdot \left(\frac{a - \frac{1.0}{3.0}}{\sqrt{9 \cdot \left(a - \frac{1.0}{3.0}\right)}}\right) + \left(a - \frac{1.0}{3.0}\right))_*\]
  3. Using strategy rm
  4. Applied fma-udef0.1

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

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

Runtime

Time bar (total: 44.1s)Debug logProfile

herbie shell --seed 2018220 +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))))