\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\]
↓
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\]
(FPCore (x y z t a b c i)
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
↓
(FPCore (x y z t a b c i)
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
↓
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
↓
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
↓
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i):
return (((x * y) + (z * t)) + (a * b)) + (c * i)
↓
def code(x, y, z, t, a, b, c, i):
return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i)
return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
↓
function code(x, y, z, t, a, b, c, i)
return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (((x * y) + (z * t)) + (a * b)) + (c * i);
end
↓
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (((x * y) + (z * t)) + (a * b)) + (c * i);
end
\[\begin{array}{l}
t_1 := c \cdot i + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -4.8 \cdot 10^{+75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -7.5 \cdot 10^{-67}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -8 \cdot 10^{-221}:\\
\;\;\;\;t \cdot z\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-318}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{-53}:\\
\;\;\;\;t \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6
Error
23.8
Cost
2008
\[\begin{array}{l}
t_1 := t \cdot z + a \cdot b\\
t_2 := c \cdot i + y \cdot x\\
\mathbf{if}\;c \cdot i \leq -2.8 \cdot 10^{-12}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq -2.3 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -1.2 \cdot 10^{-170}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 1.65 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\end{array}
\]
Alternative 7
Error
6.6
Cost
2004
\[\begin{array}{l}
t_1 := y \cdot x + \left(a \cdot b + t \cdot z\right)\\
\mathbf{if}\;a \cdot b \leq -2.8 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 22:\\
\;\;\;\;y \cdot x + \left(c \cdot i + t \cdot z\right)\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.8 \cdot 10^{+78}:\\
\;\;\;\;c \cdot i + y \cdot x\\
\mathbf{elif}\;a \cdot b \leq 7.9 \cdot 10^{+117}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 8
Error
27.4
Cost
1900
\[\begin{array}{l}
t_1 := t \cdot z + a \cdot b\\
t_2 := c \cdot i + a \cdot b\\
t_3 := y \cdot x + t \cdot z\\
t_4 := y \cdot x + a \cdot b\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-59}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-276}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-239}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-59}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 5.3 \cdot 10^{-51}:\\
\;\;\;\;t \cdot z + c \cdot i\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-36}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 19500000000000:\\
\;\;\;\;c \cdot i + y \cdot x\\
\mathbf{elif}\;t \leq 1.58 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+130}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+237}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 9
Error
23.1
Cost
1488
\[\begin{array}{l}
t_1 := c \cdot i + y \cdot x\\
t_2 := c \cdot i + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -7.2 \cdot 10^{+75}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 1.12 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 6.2 \cdot 10^{-140}:\\
\;\;\;\;t \cdot z\\
\mathbf{elif}\;a \cdot b \leq 1.7 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 10
Error
9.0
Cost
1224
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+126}:\\
\;\;\;\;t \cdot z + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 7.6 \cdot 10^{+68}:\\
\;\;\;\;y \cdot x + \left(a \cdot b + t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\end{array}
\]
Alternative 11
Error
6.5
Cost
1224
\[\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.5 \cdot 10^{-14}:\\
\;\;\;\;y \cdot x + \left(c \cdot i + t \cdot z\right)\\
\mathbf{elif}\;c \cdot i \leq 14200:\\
\;\;\;\;y \cdot x + \left(a \cdot b + t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot z + a \cdot b\right) + c \cdot i\\
\end{array}
\]
herbie shell --seed 2023074
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))