
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -4.5e+213)
(* z (* x 6.0))
(if (<= z -1.08e-26)
(* y (* z -6.0))
(if (<= z -2.4e-181)
(* y 4.0)
(if (<= z 0.65) (* x -3.0) (* -6.0 (* y z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+213) {
tmp = z * (x * 6.0);
} else if (z <= -1.08e-26) {
tmp = y * (z * -6.0);
} else if (z <= -2.4e-181) {
tmp = y * 4.0;
} else if (z <= 0.65) {
tmp = x * -3.0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4.5d+213)) then
tmp = z * (x * 6.0d0)
else if (z <= (-1.08d-26)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-2.4d-181)) then
tmp = y * 4.0d0
else if (z <= 0.65d0) then
tmp = x * (-3.0d0)
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+213) {
tmp = z * (x * 6.0);
} else if (z <= -1.08e-26) {
tmp = y * (z * -6.0);
} else if (z <= -2.4e-181) {
tmp = y * 4.0;
} else if (z <= 0.65) {
tmp = x * -3.0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e+213: tmp = z * (x * 6.0) elif z <= -1.08e-26: tmp = y * (z * -6.0) elif z <= -2.4e-181: tmp = y * 4.0 elif z <= 0.65: tmp = x * -3.0 else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e+213) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -1.08e-26) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -2.4e-181) tmp = Float64(y * 4.0); elseif (z <= 0.65) tmp = Float64(x * -3.0); else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+213) tmp = z * (x * 6.0); elseif (z <= -1.08e-26) tmp = y * (z * -6.0); elseif (z <= -2.4e-181) tmp = y * 4.0; elseif (z <= 0.65) tmp = x * -3.0; else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.5e+213], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.08e-26], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(x * -3.0), $MachinePrecision], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+213}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{-26}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -4.5000000000000002e213Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in y around 0 67.2%
Taylor expanded in z around inf 67.2%
associate-*r*67.3%
*-commutative67.3%
*-commutative67.3%
*-commutative67.3%
Simplified67.3%
if -4.5000000000000002e213 < z < -1.07999999999999996e-26Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around inf 55.0%
+-commutative55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in z around inf 53.7%
*-commutative53.7%
associate-*r*53.8%
*-commutative53.8%
Simplified53.8%
if -1.07999999999999996e-26 < z < -2.4000000000000001e-181Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 95.8%
Taylor expanded in z around 0 95.8%
Taylor expanded in y around inf 77.1%
if -2.4000000000000001e-181 < z < 0.650000000000000022Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 56.0%
*-lft-identity56.0%
*-commutative56.0%
+-commutative56.0%
*-commutative56.0%
fma-undefine56.0%
associate-*r*56.0%
fma-undefine56.0%
*-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
distribute-lft-in56.0%
metadata-eval56.0%
associate-+r+56.0%
metadata-eval56.0%
associate-*r*56.0%
metadata-eval56.0%
Simplified56.0%
Taylor expanded in z around 0 56.0%
*-commutative56.0%
Simplified56.0%
if 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 69.1%
+-commutative69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 66.9%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(if (<= z -1.8e+215)
(* 6.0 (* x z))
(if (<= z -1.08e-26)
(* y (* z -6.0))
(if (<= z -1.82e-181)
(* y 4.0)
(if (<= z 0.58) (* x -3.0) (* -6.0 (* y z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e+215) {
tmp = 6.0 * (x * z);
} else if (z <= -1.08e-26) {
tmp = y * (z * -6.0);
} else if (z <= -1.82e-181) {
tmp = y * 4.0;
} else if (z <= 0.58) {
tmp = x * -3.0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.8d+215)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1.08d-26)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-1.82d-181)) then
tmp = y * 4.0d0
else if (z <= 0.58d0) then
tmp = x * (-3.0d0)
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e+215) {
tmp = 6.0 * (x * z);
} else if (z <= -1.08e-26) {
tmp = y * (z * -6.0);
} else if (z <= -1.82e-181) {
tmp = y * 4.0;
} else if (z <= 0.58) {
tmp = x * -3.0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.8e+215: tmp = 6.0 * (x * z) elif z <= -1.08e-26: tmp = y * (z * -6.0) elif z <= -1.82e-181: tmp = y * 4.0 elif z <= 0.58: tmp = x * -3.0 else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.8e+215) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1.08e-26) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -1.82e-181) tmp = Float64(y * 4.0); elseif (z <= 0.58) tmp = Float64(x * -3.0); else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.8e+215) tmp = 6.0 * (x * z); elseif (z <= -1.08e-26) tmp = y * (z * -6.0); elseif (z <= -1.82e-181) tmp = y * 4.0; elseif (z <= 0.58) tmp = x * -3.0; else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.8e+215], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.08e-26], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.82e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.58], N[(x * -3.0), $MachinePrecision], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+215}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{-26}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.82 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.79999999999999987e215Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in y around 0 67.2%
Taylor expanded in z around inf 67.2%
if -1.79999999999999987e215 < z < -1.07999999999999996e-26Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around inf 55.0%
+-commutative55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in z around inf 53.7%
*-commutative53.7%
associate-*r*53.8%
*-commutative53.8%
Simplified53.8%
if -1.07999999999999996e-26 < z < -1.8199999999999999e-181Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 95.8%
Taylor expanded in z around 0 95.8%
Taylor expanded in y around inf 77.1%
if -1.8199999999999999e-181 < z < 0.57999999999999996Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 56.0%
*-lft-identity56.0%
*-commutative56.0%
+-commutative56.0%
*-commutative56.0%
fma-undefine56.0%
associate-*r*56.0%
fma-undefine56.0%
*-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
distribute-lft-in56.0%
metadata-eval56.0%
associate-+r+56.0%
metadata-eval56.0%
associate-*r*56.0%
metadata-eval56.0%
Simplified56.0%
Taylor expanded in z around 0 56.0%
*-commutative56.0%
Simplified56.0%
if 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 69.1%
+-commutative69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 66.9%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -3e+216)
(* 6.0 (* x z))
(if (<= z -1.08e-26)
t_0
(if (<= z -1.9e-181) (* y 4.0) (if (<= z 0.68) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -3e+216) {
tmp = 6.0 * (x * z);
} else if (z <= -1.08e-26) {
tmp = t_0;
} else if (z <= -1.9e-181) {
tmp = y * 4.0;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-3d+216)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1.08d-26)) then
tmp = t_0
else if (z <= (-1.9d-181)) then
tmp = y * 4.0d0
else if (z <= 0.68d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -3e+216) {
tmp = 6.0 * (x * z);
} else if (z <= -1.08e-26) {
tmp = t_0;
} else if (z <= -1.9e-181) {
tmp = y * 4.0;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -3e+216: tmp = 6.0 * (x * z) elif z <= -1.08e-26: tmp = t_0 elif z <= -1.9e-181: tmp = y * 4.0 elif z <= 0.68: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -3e+216) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1.08e-26) tmp = t_0; elseif (z <= -1.9e-181) tmp = Float64(y * 4.0); elseif (z <= 0.68) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -3e+216) tmp = 6.0 * (x * z); elseif (z <= -1.08e-26) tmp = t_0; elseif (z <= -1.9e-181) tmp = y * 4.0; elseif (z <= 0.68) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+216], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.08e-26], t$95$0, If[LessEqual[z, -1.9e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+216}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.9999999999999998e216Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in y around 0 67.2%
Taylor expanded in z around inf 67.2%
if -2.9999999999999998e216 < z < -1.07999999999999996e-26 or 0.680000000000000049 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around inf 62.8%
+-commutative62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in z around inf 61.0%
if -1.07999999999999996e-26 < z < -1.8999999999999999e-181Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 95.8%
Taylor expanded in z around 0 95.8%
Taylor expanded in y around inf 77.1%
if -1.8999999999999999e-181 < z < 0.680000000000000049Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 56.0%
*-lft-identity56.0%
*-commutative56.0%
+-commutative56.0%
*-commutative56.0%
fma-undefine56.0%
associate-*r*56.0%
fma-undefine56.0%
*-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
distribute-lft-in56.0%
metadata-eval56.0%
associate-+r+56.0%
metadata-eval56.0%
associate-*r*56.0%
metadata-eval56.0%
Simplified56.0%
Taylor expanded in z around 0 56.0%
*-commutative56.0%
Simplified56.0%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(if (<= x -6.6e+215)
(* x -3.0)
(if (<= x -1.1e+96)
(* 6.0 (* x z))
(if (<= x 1.5e+97) (* 6.0 (* y (- 0.6666666666666666 z))) (* x -3.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.6e+215) {
tmp = x * -3.0;
} else if (x <= -1.1e+96) {
tmp = 6.0 * (x * z);
} else if (x <= 1.5e+97) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * -3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-6.6d+215)) then
tmp = x * (-3.0d0)
else if (x <= (-1.1d+96)) then
tmp = 6.0d0 * (x * z)
else if (x <= 1.5d+97) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6.6e+215) {
tmp = x * -3.0;
} else if (x <= -1.1e+96) {
tmp = 6.0 * (x * z);
} else if (x <= 1.5e+97) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.6e+215: tmp = x * -3.0 elif x <= -1.1e+96: tmp = 6.0 * (x * z) elif x <= 1.5e+97: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.6e+215) tmp = Float64(x * -3.0); elseif (x <= -1.1e+96) tmp = Float64(6.0 * Float64(x * z)); elseif (x <= 1.5e+97) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.6e+215) tmp = x * -3.0; elseif (x <= -1.1e+96) tmp = 6.0 * (x * z); elseif (x <= 1.5e+97) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.6e+215], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, -1.1e+96], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+97], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+215}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{+96}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+97}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -6.5999999999999997e215 or 1.4999999999999999e97 < x Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 87.6%
*-lft-identity87.6%
*-commutative87.6%
+-commutative87.6%
*-commutative87.6%
fma-undefine87.6%
associate-*r*87.6%
fma-undefine87.6%
*-commutative87.6%
+-commutative87.6%
distribute-rgt-in87.6%
distribute-lft-in87.6%
metadata-eval87.6%
associate-+r+87.6%
metadata-eval87.6%
associate-*r*87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in z around 0 57.5%
*-commutative57.5%
Simplified57.5%
if -6.5999999999999997e215 < x < -1.0999999999999999e96Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around inf 63.4%
neg-mul-163.4%
Simplified63.4%
Taylor expanded in y around 0 58.5%
Taylor expanded in z around inf 58.8%
if -1.0999999999999999e96 < x < 1.4999999999999999e97Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 72.2%
Taylor expanded in x around 0 72.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.08e-26)
t_0
(if (<= z -3e-181) (* y 4.0) (if (<= z 0.68) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.08e-26) {
tmp = t_0;
} else if (z <= -3e-181) {
tmp = y * 4.0;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1.08d-26)) then
tmp = t_0
else if (z <= (-3d-181)) then
tmp = y * 4.0d0
else if (z <= 0.68d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.08e-26) {
tmp = t_0;
} else if (z <= -3e-181) {
tmp = y * 4.0;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.08e-26: tmp = t_0 elif z <= -3e-181: tmp = y * 4.0 elif z <= 0.68: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.08e-26) tmp = t_0; elseif (z <= -3e-181) tmp = Float64(y * 4.0); elseif (z <= 0.68) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.08e-26) tmp = t_0; elseif (z <= -3e-181) tmp = y * 4.0; elseif (z <= 0.68) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.08e-26], t$95$0, If[LessEqual[z, -3e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.08 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.07999999999999996e-26 or 0.680000000000000049 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 59.6%
+-commutative59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in z around inf 58.0%
if -1.07999999999999996e-26 < z < -2.99999999999999974e-181Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 95.8%
Taylor expanded in z around 0 95.8%
Taylor expanded in y around inf 77.1%
if -2.99999999999999974e-181 < z < 0.680000000000000049Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 56.0%
*-lft-identity56.0%
*-commutative56.0%
+-commutative56.0%
*-commutative56.0%
fma-undefine56.0%
associate-*r*56.0%
fma-undefine56.0%
*-commutative56.0%
+-commutative56.0%
distribute-rgt-in56.0%
distribute-lft-in56.0%
metadata-eval56.0%
associate-+r+56.0%
metadata-eval56.0%
associate-*r*56.0%
metadata-eval56.0%
Simplified56.0%
Taylor expanded in z around 0 56.0%
*-commutative56.0%
Simplified56.0%
Final simplification59.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* (- y x) (* z -6.0)) (if (<= z 0.68) (+ x (* (- y x) 4.0)) (+ x (* z (* 6.0 (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.68) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.6d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.68d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + (z * (6.0d0 * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.68) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = (y - x) * (z * -6.0) elif z <= 0.68: tmp = x + ((y - x) * 4.0) else: tmp = x + (z * (6.0 * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.68) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.6) tmp = (y - x) * (z * -6.0); elseif (z <= 0.68) tmp = x + ((y - x) * 4.0); else tmp = x + (z * (6.0 * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.68], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 95.7%
neg-mul-195.7%
Simplified95.7%
add-sqr-sqrt48.4%
fma-define48.4%
distribute-rgt-neg-out48.4%
add-sqr-sqrt0.0%
sqrt-unprod0.3%
sqr-neg0.3%
sqrt-unprod0.3%
add-sqr-sqrt0.3%
fma-neg0.3%
add-sqr-sqrt0.6%
associate-*l*0.6%
add-sqr-sqrt0.6%
sqrt-unprod0.6%
sqr-neg0.6%
sqrt-unprod0.0%
add-sqr-sqrt95.8%
*-commutative95.8%
Applied egg-rr95.8%
Taylor expanded in z around inf 95.8%
*-commutative95.8%
associate-*r*95.8%
*-commutative95.8%
associate-*r*95.8%
Simplified95.8%
if -0.599999999999999978 < z < 0.680000000000000049Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.8%
if 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 96.6%
neg-mul-196.6%
Simplified96.6%
Final simplification97.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* (- y x) (* z -6.0)) (if (<= z 0.54) (+ x (* (- y x) 4.0)) (- x (* -6.0 (* z (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.54) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x - (-6.0 * (z * (x - y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.58d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.54d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x - ((-6.0d0) * (z * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.54) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x - (-6.0 * (z * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = (y - x) * (z * -6.0) elif z <= 0.54: tmp = x + ((y - x) * 4.0) else: tmp = x - (-6.0 * (z * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.54) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x - Float64(-6.0 * Float64(z * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.58) tmp = (y - x) * (z * -6.0); elseif (z <= 0.54) tmp = x + ((y - x) * 4.0); else tmp = x - (-6.0 * (z * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.54], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x - N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x - -6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 95.7%
neg-mul-195.7%
Simplified95.7%
add-sqr-sqrt48.4%
fma-define48.4%
distribute-rgt-neg-out48.4%
add-sqr-sqrt0.0%
sqrt-unprod0.3%
sqr-neg0.3%
sqrt-unprod0.3%
add-sqr-sqrt0.3%
fma-neg0.3%
add-sqr-sqrt0.6%
associate-*l*0.6%
add-sqr-sqrt0.6%
sqrt-unprod0.6%
sqr-neg0.6%
sqrt-unprod0.0%
add-sqr-sqrt95.8%
*-commutative95.8%
Applied egg-rr95.8%
Taylor expanded in z around inf 95.8%
*-commutative95.8%
associate-*r*95.8%
*-commutative95.8%
associate-*r*95.8%
Simplified95.8%
if -0.57999999999999996 < z < 0.54000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.8%
if 0.54000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 96.6%
Final simplification97.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.62) (not (<= z 0.68))) (* (- y x) (* z -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.62) || !(z <= 0.68)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.62d0)) .or. (.not. (z <= 0.68d0))) then
tmp = (y - x) * (z * (-6.0d0))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.62) || !(z <= 0.68)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.62) or not (z <= 0.68): tmp = (y - x) * (z * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.62) || !(z <= 0.68)) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.62) || ~((z <= 0.68))) tmp = (y - x) * (z * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.62], N[Not[LessEqual[z, 0.68]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.62 \lor \neg \left(z \leq 0.68\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.619999999999999996 or 0.680000000000000049 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 96.1%
neg-mul-196.1%
Simplified96.1%
add-sqr-sqrt49.6%
fma-define49.6%
distribute-rgt-neg-out49.6%
add-sqr-sqrt25.4%
sqrt-unprod19.1%
sqr-neg19.1%
sqrt-unprod0.2%
add-sqr-sqrt0.3%
fma-neg0.3%
add-sqr-sqrt0.6%
associate-*l*0.6%
add-sqr-sqrt0.3%
sqrt-unprod38.5%
sqr-neg38.5%
sqrt-unprod48.1%
add-sqr-sqrt96.1%
*-commutative96.1%
Applied egg-rr96.1%
Taylor expanded in z around inf 96.2%
*-commutative96.2%
associate-*r*96.2%
*-commutative96.2%
associate-*r*96.2%
Simplified96.2%
if -0.619999999999999996 < z < 0.680000000000000049Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.8%
Final simplification97.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -39000000000.0) (not (<= x 1.28e+41))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -39000000000.0) || !(x <= 1.28e+41)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-39000000000.0d0)) .or. (.not. (x <= 1.28d+41))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -39000000000.0) || !(x <= 1.28e+41)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -39000000000.0) or not (x <= 1.28e+41): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -39000000000.0) || !(x <= 1.28e+41)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -39000000000.0) || ~((x <= 1.28e+41))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -39000000000.0], N[Not[LessEqual[x, 1.28e+41]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -39000000000 \lor \neg \left(x \leq 1.28 \cdot 10^{+41}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -3.9e10 or 1.27999999999999992e41 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 80.6%
*-lft-identity80.6%
*-commutative80.6%
+-commutative80.6%
*-commutative80.6%
fma-undefine80.7%
associate-*r*80.7%
fma-undefine80.6%
*-commutative80.6%
+-commutative80.6%
distribute-rgt-in80.6%
distribute-lft-in80.6%
metadata-eval80.6%
associate-+r+80.6%
metadata-eval80.6%
associate-*r*80.6%
metadata-eval80.6%
Simplified80.6%
if -3.9e10 < x < 1.27999999999999992e41Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 75.5%
Final simplification77.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -11500000000.0) (not (<= x 3.3e+41))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -11500000000.0) || !(x <= 3.3e+41)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-11500000000.0d0)) .or. (.not. (x <= 3.3d+41))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -11500000000.0) || !(x <= 3.3e+41)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -11500000000.0) or not (x <= 3.3e+41): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -11500000000.0) || !(x <= 3.3e+41)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -11500000000.0) || ~((x <= 3.3e+41))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -11500000000.0], N[Not[LessEqual[x, 3.3e+41]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -11500000000 \lor \neg \left(x \leq 3.3 \cdot 10^{+41}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -1.15e10 or 3.3e41 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 80.6%
*-lft-identity80.6%
*-commutative80.6%
+-commutative80.6%
*-commutative80.6%
fma-undefine80.7%
associate-*r*80.7%
fma-undefine80.6%
*-commutative80.6%
+-commutative80.6%
distribute-rgt-in80.6%
distribute-lft-in80.6%
metadata-eval80.6%
associate-+r+80.6%
metadata-eval80.6%
associate-*r*80.6%
metadata-eval80.6%
Simplified80.6%
if -1.15e10 < x < 3.3e41Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 75.2%
Taylor expanded in x around 0 75.4%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* (- y x) z)) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((-6.0d0) * ((y - x) * z)) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(Float64(y - x) * z)) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.4e-73) (not (<= x 2.4e+41))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4e-73) || !(x <= 2.4e+41)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.4d-73)) .or. (.not. (x <= 2.4d+41))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.4e-73) || !(x <= 2.4e+41)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.4e-73) or not (x <= 2.4e+41): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.4e-73) || !(x <= 2.4e+41)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.4e-73) || ~((x <= 2.4e+41))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4e-73], N[Not[LessEqual[x, 2.4e+41]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-73} \lor \neg \left(x \leq 2.4 \cdot 10^{+41}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.40000000000000006e-73 or 2.4000000000000002e41 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 77.0%
*-lft-identity77.0%
*-commutative77.0%
+-commutative77.0%
*-commutative77.0%
fma-undefine77.0%
associate-*r*77.0%
fma-undefine77.0%
*-commutative77.0%
+-commutative77.0%
distribute-rgt-in77.0%
distribute-lft-in77.0%
metadata-eval77.0%
associate-+r+77.0%
metadata-eval77.0%
associate-*r*77.0%
metadata-eval77.0%
Simplified77.0%
Taylor expanded in z around 0 46.0%
*-commutative46.0%
Simplified46.0%
if -1.40000000000000006e-73 < x < 2.4000000000000002e41Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 96.5%
Taylor expanded in z around 0 53.5%
Taylor expanded in y around inf 35.0%
Final simplification39.6%
(FPCore (x y z) :precision binary64 (+ x (* (* 6.0 (- x y)) (- z 0.6666666666666666))))
double code(double x, double y, double z) {
return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((6.0d0 * (x - y)) * (z - 0.6666666666666666d0))
end function
public static double code(double x, double y, double z) {
return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
def code(x, y, z): return x + ((6.0 * (x - y)) * (z - 0.6666666666666666))
function code(x, y, z) return Float64(x + Float64(Float64(6.0 * Float64(x - y)) * Float64(z - 0.6666666666666666))) end
function tmp = code(x, y, z) tmp = x + ((6.0 * (x - y)) * (z - 0.6666666666666666)); end
code[x_, y_, z_] := N[(x + N[(N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] * N[(z - 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (* y 4.0))
double code(double x, double y, double z) {
return y * 4.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * 4.0d0
end function
public static double code(double x, double y, double z) {
return y * 4.0;
}
def code(x, y, z): return y * 4.0
function code(x, y, z) return Float64(y * 4.0) end
function tmp = code(x, y, z) tmp = y * 4.0; end
code[x_, y_, z_] := N[(y * 4.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 4
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 88.1%
Taylor expanded in z around 0 59.1%
Taylor expanded in y around inf 24.8%
Final simplification24.8%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 53.8%
Taylor expanded in x around inf 2.5%
herbie shell --seed 2024130
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))