Average Error: 6.2 → 1.7
Time: 15.5s
Precision: binary64
Cost: 1216
Math TeX FPCore C \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
↓
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)\]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) ↓
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right) (FPCore (x y z t a b c i)
:precision binary64
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i)))) ↓
(FPCore (x y z t a b c i)
:precision binary64
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* c b)) (* c i))))) double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
↓
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (c * b)) * (c * i)));
}
Try it out Enter valid numbers for all inputs
Target Original 6.2 Target 1.7 Herbie 1.7
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\]
Alternatives Alternative 1 Error 4.0 Cost 1544
\[\begin{array}{l}
\mathbf{if}\;c \leq -1.4440070586394473 \cdot 10^{+82} \lor \neg \left(c \leq 1.362006270738487 \cdot 10^{+77}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\right)\\
\end{array}\]
Alternative 2 Error 7.3 Cost 1544
\[\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.404325109175153 \cdot 10^{-104} \lor \neg \left(x \cdot y \leq 5.682672477284548 \cdot 10^{-111}\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}\]
Alternative 3 Error 8.5 Cost 1288
\[\begin{array}{l}
\mathbf{if}\;c \leq -18826200670.13257 \lor \neg \left(c \leq 1.321391563360253 \cdot 10^{-13}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}\]
Alternative 4 Error 10.2 Cost 1288
\[\begin{array}{l}
\mathbf{if}\;c \leq -1.2627519629973034 \cdot 10^{+80} \lor \neg \left(c \leq 9.165609646455902 \cdot 10^{+118}\right):\\
\;\;\;\;\left(\left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}\]
Alternative 5 Error 13.7 Cost 1544
\[\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.5289489626241633 \cdot 10^{-103} \lor \neg \left(x \cdot y \leq 2.5255928342778342 \cdot 10^{-12}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\right)\\
\end{array}\]
Alternative 6 Error 19.9 Cost 1032
\[\begin{array}{l}
\mathbf{if}\;c \leq -1.1384506923570265 \cdot 10^{+80} \lor \neg \left(c \leq 2.083022499510345 \cdot 10^{-09}\right):\\
\;\;\;\;\left(\left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}\]
Alternative 7 Error 19.1 Cost 1800
\[\begin{array}{l}
\mathbf{if}\;x \cdot y + z \cdot t \leq -1.2742797768484663 \cdot 10^{-123} \lor \neg \left(x \cdot y + z \cdot t \leq 1.1942588256078403 \cdot 10^{-68}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\
\end{array}\]
Alternative 8 Error 22.2 Cost 2691
\[\begin{array}{l}
\mathbf{if}\;x \cdot y + z \cdot t \leq -1.2742797768484663 \cdot 10^{-123}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;x \cdot y + z \cdot t \leq 1.5465766376045767 \cdot 10^{-257}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{elif}\;x \cdot y + z \cdot t \leq 1.1942588256078403 \cdot 10^{-68}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}\]
Alternative 9 Error 22.3 Cost 904
\[\begin{array}{l}
\mathbf{if}\;a \leq -1.187469692550406 \cdot 10^{+220} \lor \neg \left(a \leq 2.6823562299796203 \cdot 10^{+162}\right):\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}\]
Alternative 10 Error 31.9 Cost 1425
\[\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -4.478062946668265 \cdot 10^{-08} \lor \neg \left(z \cdot t \leq 2.0650522016065681 \cdot 10^{-75} \lor \neg \left(z \cdot t \leq 0.003344819045572408\right) \land z \cdot t \leq 1.2439936353141164 \cdot 10^{+91}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}\]
Alternative 11 Error 42.8 Cost 320
\[2 \cdot \left(x \cdot y\right)\]
Alternative 12 Error 61.9 Cost 64
\[-1\]
Alternative 13 Error 61.9 Cost 64
\[1\]
Error Derivation Initial program 6.2
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)\]
Using strategy rm Applied associate-*l*_binary64_19797 1.7
\[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right)\]
Simplified1.7
\[\leadsto \color{blue}{2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)}\]
Final simplification1.7
\[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)\]
Reproduce herbie shell --seed 2021044
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))