Average Error: 7.6 → 2.2
Time: 14.7s
Precision: 64
Internal precision: 128
\[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
\[{\left(\frac{\frac{x}{t - z}}{y - z}\right)}^{1}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original7.6
Comparison8.3
Herbie2.2
\[ \begin{array}{l} \mathbf{if}\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \lt 0.0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array} \]

Derivation

  1. Initial program 7.6

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\]
  2. Using strategy rm
  3. Applied associate-/r* 2.0

    \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}}\]
  4. Using strategy rm
  5. Applied div-inv 2.1

    \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}}\]
  6. Using strategy rm
  7. Applied pow1 2.1

    \[\leadsto \frac{x}{y - z} \cdot \color{blue}{{\left(\frac{1}{t - z}\right)}^{1}}\]
  8. Applied pow1 2.1

    \[\leadsto \color{blue}{{\left(\frac{x}{y - z}\right)}^{1}} \cdot {\left(\frac{1}{t - z}\right)}^{1}\]
  9. Applied pow-prod-down 2.1

    \[\leadsto \color{blue}{{\left(\frac{x}{y - z} \cdot \frac{1}{t - z}\right)}^{1}}\]
  10. Applied simplify 2.2

    \[\leadsto {\color{blue}{\left(\frac{\frac{x}{t - z}}{y - z}\right)}}^{1}\]
  11. Removed slow pow expressions

Runtime

Time bar (total: 14.7s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2912491157 3385431288 2328715103 670497013 701277760 3608032805)'
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"

  :target
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z)))))

  (/ x (* (- y z) (- t z))))