Average Error: 0.0 → 0.0
Time: 5.1s
Precision: binary64
Cost: 704
\[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t\]
\[t + \left(0.125 \cdot x - \frac{y \cdot z}{2}\right)\]
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t
t + \left(0.125 \cdot x - \frac{y \cdot z}{2}\right)
(FPCore (x y z t)
 :precision binary64
 (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
(FPCore (x y z t) :precision binary64 (+ t (- (* 0.125 x) (/ (* y z) 2.0))))
double code(double x, double y, double z, double t) {
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
double code(double x, double y, double z, double t) {
	return t + ((0.125 * x) - ((y * z) / 2.0));
}

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
\[\left(\frac{x}{8} + t\right) - \frac{z}{2} \cdot y\]

Alternatives

Alternative 1
Error8.7
Cost1041
\[\begin{array}{l} \mathbf{if}\;x \leq -8.176580002721973 \cdot 10^{+48} \lor \neg \left(x \leq -5.057484727556827 \cdot 10^{-53} \lor \neg \left(x \leq -1.0788721107487467 \cdot 10^{-85}\right) \land x \leq 1.532489665290679 \cdot 10^{-21}\right):\\ \;\;\;\;t + 0.125 \cdot x\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot \left(z \cdot -0.5\right)\\ \end{array}\]
Alternative 2
Error19.7
Cost1604
\[\begin{array}{l} \mathbf{if}\;x \leq -3.855393177388864 \cdot 10^{-86}:\\ \;\;\;\;t + 0.125 \cdot x\\ \mathbf{elif}\;x \leq -5.172269849145321 \cdot 10^{-227}:\\ \;\;\;\;y \cdot \left(z \cdot -0.5\right)\\ \mathbf{elif}\;x \leq 1.9610474508382725 \cdot 10^{-234}:\\ \;\;\;\;t\\ \mathbf{elif}\;x \leq 9.794390896182257 \cdot 10^{-127}:\\ \;\;\;\;y \cdot \left(z \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;t + 0.125 \cdot x\\ \end{array}\]
Alternative 3
Error29.7
Cost2439
\[\begin{array}{l} \mathbf{if}\;t \leq -6.56771827726143 \cdot 10^{+115}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq -8.951365269554362 \cdot 10^{+27}:\\ \;\;\;\;0.125 \cdot x\\ \mathbf{elif}\;t \leq -1.434722951148415 \cdot 10^{+26}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq -1.621723876421443 \cdot 10^{-302}:\\ \;\;\;\;y \cdot \left(z \cdot -0.5\right)\\ \mathbf{elif}\;t \leq 1.3706893997187718 \cdot 10^{-232}:\\ \;\;\;\;0.125 \cdot x\\ \mathbf{elif}\;t \leq 1.4812177819861442 \cdot 10^{-192}:\\ \;\;\;\;y \cdot \left(z \cdot -0.5\right)\\ \mathbf{elif}\;t \leq 2.2413743845662883 \cdot 10^{+17}:\\ \;\;\;\;0.125 \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]
Alternative 4
Error28.3
Cost973
\[\begin{array}{l} \mathbf{if}\;t \leq -6.327233867333813 \cdot 10^{+115}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq -3.836583348485561 \cdot 10^{+27} \lor \neg \left(t \leq -1.9763065278790593 \cdot 10^{-21}\right) \land t \leq 1.929918991048647 \cdot 10^{+17}:\\ \;\;\;\;0.125 \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array}\]
Alternative 5
Error40.1
Cost64
\[t\]
Alternative 6
Error62.0
Cost64
\[-1\]
Alternative 7
Error62.0
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t\]
  2. Simplified0.0

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

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

    \[\leadsto t + \left(0.125 \cdot x - \frac{y \cdot z}{2}\right)\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, B"
  :precision binary64

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

  (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))