Average Error: 0.0 → 0.0
Time: 8.9s
Precision: binary64
Cost: 832
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[x + \left(\left(y - z\right) \cdot t + x \cdot \left(z - y\right)\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
x + \left(\left(y - z\right) \cdot t + x \cdot \left(z - y\right)\right)
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
(FPCore (x y z t) :precision binary64 (+ x (+ (* (- y z) t) (* x (- z y)))))
double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
double code(double x, double y, double z, double t) {
	return x + (((y - z) * t) + (x * (z - y)));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)\]

Alternatives

Alternative 1
Error0.0
Cost576
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
Alternative 2
Error10.9
Cost1411
\[\begin{array}{l} \mathbf{if}\;y \leq -1.7154440141169672 \cdot 10^{-13}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 4.350383350346763 \cdot 10^{-199}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 3.2635788916509198 \cdot 10^{+25}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array}\]
Alternative 3
Error11.7
Cost1732
\[\begin{array}{l} \mathbf{if}\;z \leq -3.148758913237028 \cdot 10^{+34}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 8.451755665464782 \cdot 10^{-218}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 3.2741739785192826 \cdot 10^{-23}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 1148817319671.21:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array}\]
Alternative 4
Error13.7
Cost776
\[\begin{array}{l} \mathbf{if}\;y \leq -9.190953743357998 \cdot 10^{+44} \lor \neg \left(y \leq 3.1142909315022278 \cdot 10^{+25}\right):\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array}\]
Alternative 5
Error26.5
Cost1283
\[\begin{array}{l} \mathbf{if}\;y \leq -1.8300309072657017 \cdot 10^{-13}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 5.755631945079793 \cdot 10^{-241}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 3.1142909315022278 \cdot 10^{+25}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array}\]
Alternative 6
Error26.1
Cost648
\[\begin{array}{l} \mathbf{if}\;z \leq -3.148758913237028 \cdot 10^{+34} \lor \neg \left(z \leq 1092764626258.7595\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array}\]
Alternative 7
Error39.2
Cost320
\[z \cdot \left(x - t\right)\]
Alternative 8
Error61.9
Cost64
\[-1\]
Alternative 9
Error61.9
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[x + \left(y - z\right) \cdot \left(t - x\right)\]
  2. Using strategy rm
  3. Applied sub-neg_binary64_232590.0

    \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(t + \left(-x\right)\right)}\]
  4. Applied distribute-rgt-in_binary64_232160.0

    \[\leadsto x + \color{blue}{\left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)}\]
  5. Simplified0.0

    \[\leadsto x + \left(\color{blue}{\left(y - z\right) \cdot t} + \left(-x\right) \cdot \left(y - z\right)\right)\]
  6. Simplified0.0

    \[\leadsto x + \left(\left(y - z\right) \cdot t + \color{blue}{x \cdot \left(z - y\right)}\right)\]
  7. Simplified0.0

    \[\leadsto \color{blue}{x + \left(\left(y - z\right) \cdot t + x \cdot \left(z - y\right)\right)}\]
  8. Final simplification0.0

    \[\leadsto x + \left(\left(y - z\right) \cdot t + x \cdot \left(z - y\right)\right)\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

  :herbie-target
  (+ x (+ (* t (- y z)) (* (- x) (- y z))))

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