Average Error: 0.1 → 0.2
Time: 3.0m
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)\]
\[\left(\left(rand \cdot \sqrt{\frac{1}{\sqrt{\left(a - \frac{1.0}{3.0}\right) \cdot 9}}}\right) \cdot \sqrt{\frac{1}{\sqrt{\left(a - \frac{1.0}{3.0}\right) \cdot 9}}} + 1\right) \cdot \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. 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. Applied associate-*l*0.2

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

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

Runtime

Time bar (total: 3.0m)Debug logProfile

herbie shell --seed 2018214 
(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))))