
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j) :precision binary64 (- (+ (* i (- (* b t) (* j y))) (+ (* a (* j c)) (* x (- (* y z) (* t a))))) (* b (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((i * ((b * t) - (j * y))) + ((a * (j * c)) + (x * ((y * z) - (t * a))))) - (b * (c * z));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = ((i * ((b * t) - (j * y))) + ((a * (j * c)) + (x * ((y * z) - (t * a))))) - (b * (c * z))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((i * ((b * t) - (j * y))) + ((a * (j * c)) + (x * ((y * z) - (t * a))))) - (b * (c * z));
}
def code(x, y, z, t, a, b, c, i, j): return ((i * ((b * t) - (j * y))) + ((a * (j * c)) + (x * ((y * z) - (t * a))))) - (b * (c * z))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) + Float64(Float64(a * Float64(j * c)) + Float64(x * Float64(Float64(y * z) - Float64(t * a))))) - Float64(b * Float64(c * z))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((i * ((b * t) - (j * y))) + ((a * (j * c)) + (x * ((y * z) - (t * a))))) - (b * (c * z)); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(j * c), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(i \cdot \left(b \cdot t - j \cdot y\right) + \left(a \cdot \left(j \cdot c\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)\right) - b \cdot \left(c \cdot z\right)
\end{array}
Initial program 77.9%
Taylor expanded in i around -inf 79.3%
Final simplification79.3%
(FPCore (x y z t a b c i j) :precision binary64 (+ (+ (* x (- (* y z) (* t a))) (* b (- (* i t) (* c z)))) (* j (- (* a c) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) + Float64(b * Float64(Float64(i * t) - Float64(c * z)))) + Float64(j * Float64(Float64(a * c) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(i \cdot t - c \cdot z\right)\right) + j \cdot \left(a \cdot c - i \cdot y\right)
\end{array}
Initial program 77.9%
Final simplification77.9%
(FPCore (x y z t a b c i j) :precision binary64 (+ (+ (* z (* y x)) (* b (- (* i t) (* c z)))) (* j (- (* a c) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((z * (y * x)) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = ((z * (y * x)) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((z * (y * x)) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((z * (y * x)) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(z * Float64(y * x)) + Float64(b * Float64(Float64(i * t) - Float64(c * z)))) + Float64(j * Float64(Float64(a * c) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((z * (y * x)) + (b * ((i * t) - (c * z)))) + (j * ((a * c) - (i * y))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot \left(y \cdot x\right) + b \cdot \left(i \cdot t - c \cdot z\right)\right) + j \cdot \left(a \cdot c - i \cdot y\right)
\end{array}
Initial program 77.9%
Taylor expanded in y around inf 67.4%
*-commutative67.4%
*-commutative67.4%
associate-*l*69.0%
Simplified69.0%
Final simplification69.0%
(FPCore (x y z t a b c i j) :precision binary64 (- (* b (- (* i t) (* c z))) (* j (- (* i y) (* a c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * ((i * t) - (c * z))) - (j * ((i * y) - (a * c)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = (b * ((i * t) - (c * z))) - (j * ((i * y) - (a * c)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * ((i * t) - (c * z))) - (j * ((i * y) - (a * c)));
}
def code(x, y, z, t, a, b, c, i, j): return (b * ((i * t) - (c * z))) - (j * ((i * y) - (a * c)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(b * Float64(Float64(i * t) - Float64(c * z))) - Float64(j * Float64(Float64(i * y) - Float64(a * c)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (b * ((i * t) - (c * z))) - (j * ((i * y) - (a * c))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(N[(i * y), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(i \cdot t - c \cdot z\right) - j \cdot \left(i \cdot y - a \cdot c\right)
\end{array}
Initial program 77.9%
Taylor expanded in x around 0 60.5%
*-commutative60.5%
Simplified60.5%
Final simplification60.5%
(FPCore (x y z t a b c i j) :precision binary64 (+ (* x (- (* y z) (* t a))) (* b (- (* i t) (* c z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = (x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)));
}
def code(x, y, z, t, a, b, c, i, j): return (x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) + Float64(b * Float64(Float64(i * t) - Float64(c * z)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (x * ((y * z) - (t * a))) + (b * ((i * t) - (c * z))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(i \cdot t - c \cdot z\right)
\end{array}
Initial program 77.9%
Taylor expanded in j around 0 63.5%
*-commutative63.5%
*-commutative63.5%
Simplified63.5%
Final simplification63.5%
(FPCore (x y z t a b c i j) :precision binary64 (- (* j (- (* a c) (* i y))) (* c (* b z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * ((a * c) - (i * y))) - (c * (b * z));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = (j * ((a * c) - (i * y))) - (c * (b * z))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * ((a * c) - (i * y))) - (c * (b * z));
}
def code(x, y, z, t, a, b, c, i, j): return (j * ((a * c) - (i * y))) - (c * (b * z))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(j * Float64(Float64(a * c) - Float64(i * y))) - Float64(c * Float64(b * z))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (j * ((a * c) - (i * y))) - (c * (b * z)); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
j \cdot \left(a \cdot c - i \cdot y\right) - c \cdot \left(b \cdot z\right)
\end{array}
Initial program 77.9%
Taylor expanded in x around 0 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in c around inf 48.1%
*-commutative48.1%
associate-*l*47.2%
Simplified47.2%
Final simplification47.2%
(FPCore (x y z t a b c i j) :precision binary64 (- (* x (- (* y z) (* t a))) (* c (* b z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (x * ((y * z) - (t * a))) - (c * (b * z));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = (x * ((y * z) - (t * a))) - (c * (b * z))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (x * ((y * z) - (t * a))) - (c * (b * z));
}
def code(x, y, z, t, a, b, c, i, j): return (x * ((y * z) - (t * a))) - (c * (b * z))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(c * Float64(b * z))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (x * ((y * z) - (t * a))) - (c * (b * z)); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y \cdot z - t \cdot a\right) - c \cdot \left(b \cdot z\right)
\end{array}
Initial program 77.9%
Taylor expanded in j around 0 63.5%
*-commutative63.5%
*-commutative63.5%
Simplified63.5%
Taylor expanded in c around inf 51.9%
*-commutative48.1%
associate-*l*47.2%
Simplified49.8%
Final simplification49.8%
(FPCore (x y z t a b c i j) :precision binary64 (* a (- (* j c) (* t x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * ((j * c) - (t * x));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = a * ((j * c) - (t * x))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * ((j * c) - (t * x));
}
def code(x, y, z, t, a, b, c, i, j): return a * ((j * c) - (t * x))
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(Float64(j * c) - Float64(t * x))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * ((j * c) - (t * x)); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(N[(j * c), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(j \cdot c - t \cdot x\right)
\end{array}
Initial program 77.9%
Taylor expanded in a around inf 40.8%
+-commutative40.8%
mul-1-neg40.8%
unsub-neg40.8%
Simplified40.8%
Final simplification40.8%
(FPCore (x y z t a b c i j) :precision binary64 (* b (- (* i t) (* c z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return b * ((i * t) - (c * z));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = b * ((i * t) - (c * z))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return b * ((i * t) - (c * z));
}
def code(x, y, z, t, a, b, c, i, j): return b * ((i * t) - (c * z))
function code(x, y, z, t, a, b, c, i, j) return Float64(b * Float64(Float64(i * t) - Float64(c * z))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = b * ((i * t) - (c * z)); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(i \cdot t - c \cdot z\right)
\end{array}
Initial program 77.9%
Taylor expanded in b around inf 43.3%
Final simplification43.3%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* j c)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (j * c);
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = a * (j * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (j * c);
}
def code(x, y, z, t, a, b, c, i, j): return a * (j * c)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(j * c)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (j * c); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(j * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(j \cdot c\right)
\end{array}
Initial program 77.9%
Taylor expanded in a around inf 40.8%
+-commutative40.8%
mul-1-neg40.8%
unsub-neg40.8%
Simplified40.8%
Taylor expanded in c around inf 22.1%
*-commutative22.1%
Simplified22.1%
Final simplification22.1%
(FPCore (x y z t a b c i j) :precision binary64 (* b (* i t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return b * (i * t);
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = b * (i * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return b * (i * t);
}
def code(x, y, z, t, a, b, c, i, j): return b * (i * t)
function code(x, y, z, t, a, b, c, i, j) return Float64(b * Float64(i * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = b * (i * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(i \cdot t\right)
\end{array}
Initial program 77.9%
Taylor expanded in j around 0 63.5%
*-commutative63.5%
*-commutative63.5%
Simplified63.5%
Taylor expanded in i around inf 23.4%
Final simplification23.4%
(FPCore (x y z t a b c i j) :precision binary64 (* i (* b t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return i * (b * t);
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
code = i * (b * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return i * (b * t);
}
def code(x, y, z, t, a, b, c, i, j): return i * (b * t)
function code(x, y, z, t, a, b, c, i, j) return Float64(i * Float64(b * t)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = i * (b * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(i * N[(b * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot \left(b \cdot t\right)
\end{array}
Initial program 77.9%
Taylor expanded in i around inf 39.8%
distribute-lft-out--39.8%
Simplified39.8%
Taylor expanded in j around 0 23.4%
Simplified23.4%
Taylor expanded in b around 0 23.4%
*-commutative23.4%
associate-*l*26.3%
*-commutative26.3%
Simplified26.3%
Final simplification26.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i))))
(t_2
(+
(-
(* x (- (* y z) (* t a)))
(/
(* b (- (pow (* c z) 2.0) (pow (* t i) 2.0)))
(+ (* c z) (* t i))))
t_1)))
(if (< x -1.469694296777705e-64)
t_2
(if (< x 3.2113527362226803e-147)
(- (* (- (* b i) (* x a)) t) (- (* z (* c b)) t_1))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (pow((c * z), 2.0) - pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j)
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
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * ((c * a) - (y * i))
t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
if (x < (-1.469694296777705d-64)) then
tmp = t_2
else if (x < 3.2113527362226803d-147) then
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * a) - (y * i)) t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1 tmp = 0 if x < -1.469694296777705e-64: tmp = t_2 elif x < 3.2113527362226803e-147: tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1) tmp = 0.0 if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((c * a) - (y * i)); t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1; tmp = 0.0; if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024033
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:herbie-target
(if (< x -1.469694296777705e-64) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 3.2113527362226803e-147) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))