
(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 15 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 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - 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) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z)
:precision binary64
(if (<= z -0.66)
(* -6.0 (* y z))
(if (<= z 2.3e-129)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 4.5e+264) (* z (* x 6.0)) (* y (* z -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= 2.3e-129) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 4.5e+264) {
tmp = z * (x * 6.0);
} else {
tmp = y * (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 (z <= (-0.66d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= 2.3d-129) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 4.5d+264) then
tmp = z * (x * 6.0d0)
else
tmp = y * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= 2.3e-129) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 4.5e+264) {
tmp = z * (x * 6.0);
} else {
tmp = y * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = -6.0 * (y * z) elif z <= 2.3e-129: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 4.5e+264: tmp = z * (x * 6.0) else: tmp = y * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= 2.3e-129) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 4.5e+264) tmp = Float64(z * Float64(x * 6.0)); else tmp = Float64(y * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = -6.0 * (y * z); elseif (z <= 2.3e-129) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 4.5e+264) tmp = z * (x * 6.0); else tmp = y * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-129], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e+264], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+264}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
Taylor expanded in y around inf 55.8%
if -0.660000000000000031 < z < 2.3e-129Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.2%
associate-*r*62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
Simplified61.5%
if 2.3e-129 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 72.3%
*-lft-identity72.3%
*-commutative72.3%
+-commutative72.3%
*-commutative72.3%
fma-define72.3%
associate-*r*72.3%
fma-define72.3%
distribute-lft-in72.3%
neg-mul-172.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-rgt-in72.2%
+-commutative72.2%
sub-neg72.2%
distribute-rgt-in72.2%
sub-neg72.2%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
Simplified72.3%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
if 0.5 < z < 4.50000000000000003e264Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 61.7%
associate-*r/61.7%
metadata-eval61.7%
Simplified61.7%
Taylor expanded in z around inf 60.8%
if 4.50000000000000003e264 < z Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in y around inf 79.1%
*-commutative79.1%
associate-*r*79.1%
Simplified79.1%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(if (<= z -0.66)
(* -6.0 (* y z))
(if (<= z 1.45e-124)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 3.6e+266) (* x (* 6.0 z)) (* y (* z -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= 1.45e-124) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 3.6e+266) {
tmp = x * (6.0 * z);
} else {
tmp = y * (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 (z <= (-0.66d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= 1.45d-124) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 3.6d+266) then
tmp = x * (6.0d0 * z)
else
tmp = y * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= 1.45e-124) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 3.6e+266) {
tmp = x * (6.0 * z);
} else {
tmp = y * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = -6.0 * (y * z) elif z <= 1.45e-124: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 3.6e+266: tmp = x * (6.0 * z) else: tmp = y * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= 1.45e-124) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 3.6e+266) tmp = Float64(x * Float64(6.0 * z)); else tmp = Float64(y * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = -6.0 * (y * z); elseif (z <= 1.45e-124) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 3.6e+266) tmp = x * (6.0 * z); else tmp = y * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.6e+266], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+266}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
Taylor expanded in y around inf 55.8%
if -0.660000000000000031 < z < 1.4500000000000001e-124Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.2%
associate-*r*62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
Simplified61.5%
if 1.4500000000000001e-124 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 72.3%
*-lft-identity72.3%
*-commutative72.3%
+-commutative72.3%
*-commutative72.3%
fma-define72.3%
associate-*r*72.3%
fma-define72.3%
distribute-lft-in72.3%
neg-mul-172.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-rgt-in72.2%
+-commutative72.2%
sub-neg72.2%
distribute-rgt-in72.2%
sub-neg72.2%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
Simplified72.3%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
if 0.5 < z < 3.59999999999999988e266Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 61.6%
*-lft-identity61.6%
*-commutative61.6%
+-commutative61.6%
*-commutative61.6%
fma-define61.6%
associate-*r*61.6%
fma-define61.6%
distribute-lft-in61.6%
neg-mul-161.6%
distribute-lft-neg-in61.6%
metadata-eval61.6%
metadata-eval61.6%
distribute-rgt-in61.5%
+-commutative61.5%
sub-neg61.5%
distribute-rgt-in61.5%
sub-neg61.5%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.6%
Simplified61.6%
Taylor expanded in z around inf 60.7%
if 3.59999999999999988e266 < z Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in y around inf 79.1%
*-commutative79.1%
associate-*r*79.1%
Simplified79.1%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.66)
t_0
(if (<= z 1.3e-127)
(* y 4.0)
(if (<= z 0.5) (* x -3.0) (if (<= z 2.2e+265) (* x (* 6.0 z)) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 1.3e-127) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 2.2e+265) {
tmp = x * (6.0 * z);
} 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 <= (-0.66d0)) then
tmp = t_0
else if (z <= 1.3d-127) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 2.2d+265) then
tmp = x * (6.0d0 * z)
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 <= -0.66) {
tmp = t_0;
} else if (z <= 1.3e-127) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 2.2e+265) {
tmp = x * (6.0 * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.66: tmp = t_0 elif z <= 1.3e-127: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 2.2e+265: tmp = x * (6.0 * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.66) tmp = t_0; elseif (z <= 1.3e-127) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 2.2e+265) tmp = Float64(x * Float64(6.0 * z)); 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 <= -0.66) tmp = t_0; elseif (z <= 1.3e-127) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 2.2e+265) tmp = x * (6.0 * z); 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, -0.66], t$95$0, If[LessEqual[z, 1.3e-127], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.2e+265], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-127}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+265}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 2.1999999999999999e265 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.6%
Taylor expanded in z around inf 98.6%
Taylor expanded in y around inf 57.7%
if -0.660000000000000031 < z < 1.29999999999999995e-127Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.2%
associate-*r*62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
Simplified61.5%
if 1.29999999999999995e-127 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 72.3%
*-lft-identity72.3%
*-commutative72.3%
+-commutative72.3%
*-commutative72.3%
fma-define72.3%
associate-*r*72.3%
fma-define72.3%
distribute-lft-in72.3%
neg-mul-172.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-rgt-in72.2%
+-commutative72.2%
sub-neg72.2%
distribute-rgt-in72.2%
sub-neg72.2%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
Simplified72.3%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
if 0.5 < z < 2.1999999999999999e265Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 61.6%
*-lft-identity61.6%
*-commutative61.6%
+-commutative61.6%
*-commutative61.6%
fma-define61.6%
associate-*r*61.6%
fma-define61.6%
distribute-lft-in61.6%
neg-mul-161.6%
distribute-lft-neg-in61.6%
metadata-eval61.6%
metadata-eval61.6%
distribute-rgt-in61.5%
+-commutative61.5%
sub-neg61.5%
distribute-rgt-in61.5%
sub-neg61.5%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.6%
Simplified61.6%
Taylor expanded in z around inf 60.7%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.66)
t_0
(if (<= z 2.8e-129)
(* y 4.0)
(if (<= z 0.5) (* x -3.0) (if (<= z 1.05e+265) (* 6.0 (* x z)) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 2.8e-129) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 1.05e+265) {
tmp = 6.0 * (x * z);
} 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 <= (-0.66d0)) then
tmp = t_0
else if (z <= 2.8d-129) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 1.05d+265) then
tmp = 6.0d0 * (x * z)
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 <= -0.66) {
tmp = t_0;
} else if (z <= 2.8e-129) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 1.05e+265) {
tmp = 6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.66: tmp = t_0 elif z <= 2.8e-129: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 1.05e+265: tmp = 6.0 * (x * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.66) tmp = t_0; elseif (z <= 2.8e-129) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 1.05e+265) tmp = Float64(6.0 * Float64(x * z)); 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 <= -0.66) tmp = t_0; elseif (z <= 2.8e-129) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 1.05e+265) tmp = 6.0 * (x * z); 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, -0.66], t$95$0, If[LessEqual[z, 2.8e-129], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05e+265], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-129}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+265}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 1.0499999999999999e265 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.6%
Taylor expanded in z around inf 98.6%
Taylor expanded in y around inf 57.7%
if -0.660000000000000031 < z < 2.7999999999999999e-129Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.2%
associate-*r*62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
Simplified61.5%
if 2.7999999999999999e-129 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 72.3%
*-lft-identity72.3%
*-commutative72.3%
+-commutative72.3%
*-commutative72.3%
fma-define72.3%
associate-*r*72.3%
fma-define72.3%
distribute-lft-in72.3%
neg-mul-172.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-rgt-in72.2%
+-commutative72.2%
sub-neg72.2%
distribute-rgt-in72.2%
sub-neg72.2%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
Simplified72.3%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
if 0.5 < z < 1.0499999999999999e265Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 61.6%
*-lft-identity61.6%
*-commutative61.6%
+-commutative61.6%
*-commutative61.6%
fma-define61.6%
associate-*r*61.6%
fma-define61.6%
distribute-lft-in61.6%
neg-mul-161.6%
distribute-lft-neg-in61.6%
metadata-eval61.6%
metadata-eval61.6%
distribute-rgt-in61.5%
+-commutative61.5%
sub-neg61.5%
distribute-rgt-in61.5%
sub-neg61.5%
distribute-rgt-in61.6%
metadata-eval61.6%
distribute-lft-neg-in61.6%
associate-+r+61.6%
Simplified61.6%
Taylor expanded in z around inf 60.6%
*-commutative60.6%
Simplified60.6%
Final simplification61.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -4.8e-5)
t_0
(if (<= z 8.6e-127)
(* y 4.0)
(if (<= z 410000000.0) (* x (+ -3.0 (* 6.0 z))) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.8e-5) {
tmp = t_0;
} else if (z <= 8.6e-127) {
tmp = y * 4.0;
} else if (z <= 410000000.0) {
tmp = x * (-3.0 + (6.0 * z));
} 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 - x) * z)
if (z <= (-4.8d-5)) then
tmp = t_0
else if (z <= 8.6d-127) then
tmp = y * 4.0d0
else if (z <= 410000000.0d0) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
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 - x) * z);
double tmp;
if (z <= -4.8e-5) {
tmp = t_0;
} else if (z <= 8.6e-127) {
tmp = y * 4.0;
} else if (z <= 410000000.0) {
tmp = x * (-3.0 + (6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -4.8e-5: tmp = t_0 elif z <= 8.6e-127: tmp = y * 4.0 elif z <= 410000000.0: tmp = x * (-3.0 + (6.0 * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -4.8e-5) tmp = t_0; elseif (z <= 8.6e-127) tmp = Float64(y * 4.0); elseif (z <= 410000000.0) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -4.8e-5) tmp = t_0; elseif (z <= 8.6e-127) tmp = y * 4.0; elseif (z <= 410000000.0) tmp = x * (-3.0 + (6.0 * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-5], t$95$0, If[LessEqual[z, 8.6e-127], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 410000000.0], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-127}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 410000000:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.8000000000000001e-5 or 4.1e8 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.3%
Taylor expanded in z around inf 98.4%
if -4.8000000000000001e-5 < z < 8.59999999999999967e-127Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.9%
associate-*r*62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in z around 0 62.1%
*-commutative62.1%
Simplified62.1%
if 8.59999999999999967e-127 < z < 4.1e8Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 73.4%
*-lft-identity73.4%
*-commutative73.4%
+-commutative73.4%
*-commutative73.4%
fma-define73.4%
associate-*r*73.4%
fma-define73.4%
distribute-lft-in73.4%
neg-mul-173.4%
distribute-lft-neg-in73.4%
metadata-eval73.4%
metadata-eval73.4%
distribute-rgt-in73.1%
+-commutative73.1%
sub-neg73.1%
distribute-rgt-in73.1%
sub-neg73.1%
distribute-rgt-in73.4%
metadata-eval73.4%
distribute-lft-neg-in73.4%
associate-+r+73.4%
Simplified73.4%
Final simplification82.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -4.8e-5)
t_0
(if (<= z 4.4e-125) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.8e-5) {
tmp = t_0;
} else if (z <= 4.4e-125) {
tmp = y * 4.0;
} else if (z <= 0.5) {
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 - x) * z)
if (z <= (-4.8d-5)) then
tmp = t_0
else if (z <= 4.4d-125) then
tmp = y * 4.0d0
else if (z <= 0.5d0) 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 - x) * z);
double tmp;
if (z <= -4.8e-5) {
tmp = t_0;
} else if (z <= 4.4e-125) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -4.8e-5: tmp = t_0 elif z <= 4.4e-125: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -4.8e-5) tmp = t_0; elseif (z <= 4.4e-125) tmp = Float64(y * 4.0); elseif (z <= 0.5) 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 - x) * z); tmp = 0.0; if (z <= -4.8e-5) tmp = t_0; elseif (z <= 4.4e-125) tmp = y * 4.0; elseif (z <= 0.5) 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[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-5], t$95$0, If[LessEqual[z, 4.4e-125], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.8000000000000001e-5 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.0%
Taylor expanded in z around inf 98.1%
if -4.8000000000000001e-5 < z < 4.3999999999999999e-125Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.9%
associate-*r*62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in z around 0 62.1%
*-commutative62.1%
Simplified62.1%
if 4.3999999999999999e-125 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 72.3%
*-lft-identity72.3%
*-commutative72.3%
+-commutative72.3%
*-commutative72.3%
fma-define72.3%
associate-*r*72.3%
fma-define72.3%
distribute-lft-in72.3%
neg-mul-172.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-rgt-in72.2%
+-commutative72.2%
sub-neg72.2%
distribute-rgt-in72.2%
sub-neg72.2%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
Simplified72.3%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
Final simplification82.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.66)
t_0
(if (<= z 1.7e-124) (* y 4.0) (if (<= z 0.56) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 1.7e-124) {
tmp = y * 4.0;
} else if (z <= 0.56) {
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 <= (-0.66d0)) then
tmp = t_0
else if (z <= 1.7d-124) then
tmp = y * 4.0d0
else if (z <= 0.56d0) 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 <= -0.66) {
tmp = t_0;
} else if (z <= 1.7e-124) {
tmp = y * 4.0;
} else if (z <= 0.56) {
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 <= -0.66: tmp = t_0 elif z <= 1.7e-124: tmp = y * 4.0 elif z <= 0.56: 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 <= -0.66) tmp = t_0; elseif (z <= 1.7e-124) tmp = Float64(y * 4.0); elseif (z <= 0.56) 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 <= -0.66) tmp = t_0; elseif (z <= 1.7e-124) tmp = y * 4.0; elseif (z <= 0.56) 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, -0.66], t$95$0, If[LessEqual[z, 1.7e-124], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.56], 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 -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.56000000000000005 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.7%
Taylor expanded in z around inf 98.7%
Taylor expanded in y around inf 52.3%
if -0.660000000000000031 < z < 1.7e-124Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 62.2%
associate-*r*62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
Simplified61.5%
if 1.7e-124 < z < 0.56000000000000005Initial program 99.3%
+-commutative99.3%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 72.3%
*-lft-identity72.3%
*-commutative72.3%
+-commutative72.3%
*-commutative72.3%
fma-define72.3%
associate-*r*72.3%
fma-define72.3%
distribute-lft-in72.3%
neg-mul-172.3%
distribute-lft-neg-in72.3%
metadata-eval72.3%
metadata-eval72.3%
distribute-rgt-in72.2%
+-commutative72.2%
sub-neg72.2%
distribute-rgt-in72.2%
sub-neg72.2%
distribute-rgt-in72.3%
metadata-eval72.3%
distribute-lft-neg-in72.3%
associate-+r+72.3%
Simplified72.3%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
Simplified71.3%
Final simplification57.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -8.4e-35) (not (<= x 2.1e-18))) (* x (+ -3.0 (* 6.0 z))) (* (- 0.6666666666666666 z) (* y 6.0))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -8.4e-35) || !(x <= 2.1e-18)) {
tmp = x * (-3.0 + (6.0 * z));
} else {
tmp = (0.6666666666666666 - z) * (y * 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 <= (-8.4d-35)) .or. (.not. (x <= 2.1d-18))) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
else
tmp = (0.6666666666666666d0 - z) * (y * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -8.4e-35) || !(x <= 2.1e-18)) {
tmp = x * (-3.0 + (6.0 * z));
} else {
tmp = (0.6666666666666666 - z) * (y * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -8.4e-35) or not (x <= 2.1e-18): tmp = x * (-3.0 + (6.0 * z)) else: tmp = (0.6666666666666666 - z) * (y * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -8.4e-35) || !(x <= 2.1e-18)) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); else tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -8.4e-35) || ~((x <= 2.1e-18))) tmp = x * (-3.0 + (6.0 * z)); else tmp = (0.6666666666666666 - z) * (y * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -8.4e-35], N[Not[LessEqual[x, 2.1e-18]], $MachinePrecision]], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{-35} \lor \neg \left(x \leq 2.1 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\end{array}
\end{array}
if x < -8.3999999999999999e-35 or 2.1e-18 < 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 78.5%
*-lft-identity78.5%
*-commutative78.5%
+-commutative78.5%
*-commutative78.5%
fma-define78.5%
associate-*r*78.5%
fma-define78.5%
distribute-lft-in78.5%
neg-mul-178.5%
distribute-lft-neg-in78.5%
metadata-eval78.5%
metadata-eval78.5%
distribute-rgt-in78.5%
+-commutative78.5%
sub-neg78.5%
distribute-rgt-in78.5%
sub-neg78.5%
distribute-rgt-in78.5%
metadata-eval78.5%
distribute-lft-neg-in78.5%
associate-+r+78.5%
Simplified78.5%
if -8.3999999999999999e-35 < x < 2.1e-18Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 98.6%
Taylor expanded in y around inf 88.1%
associate-*r*88.1%
*-commutative88.1%
Simplified88.1%
Final simplification82.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.42e-33) (not (<= x 1.65e-18))) (* x (+ -3.0 (* 6.0 z))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.42e-33) || !(x <= 1.65e-18)) {
tmp = x * (-3.0 + (6.0 * z));
} 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 <= (-1.42d-33)) .or. (.not. (x <= 1.65d-18))) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
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 <= -1.42e-33) || !(x <= 1.65e-18)) {
tmp = x * (-3.0 + (6.0 * z));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.42e-33) or not (x <= 1.65e-18): tmp = x * (-3.0 + (6.0 * z)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.42e-33) || !(x <= 1.65e-18)) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); 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 <= -1.42e-33) || ~((x <= 1.65e-18))) tmp = x * (-3.0 + (6.0 * z)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.42e-33], N[Not[LessEqual[x, 1.65e-18]], $MachinePrecision]], N[(x * N[(-3.0 + N[(6.0 * z), $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 -1.42 \cdot 10^{-33} \lor \neg \left(x \leq 1.65 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -1.42000000000000007e-33 or 1.6500000000000001e-18 < 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 78.5%
*-lft-identity78.5%
*-commutative78.5%
+-commutative78.5%
*-commutative78.5%
fma-define78.5%
associate-*r*78.5%
fma-define78.5%
distribute-lft-in78.5%
neg-mul-178.5%
distribute-lft-neg-in78.5%
metadata-eval78.5%
metadata-eval78.5%
distribute-rgt-in78.5%
+-commutative78.5%
sub-neg78.5%
distribute-rgt-in78.5%
sub-neg78.5%
distribute-rgt-in78.5%
metadata-eval78.5%
distribute-lft-neg-in78.5%
associate-+r+78.5%
Simplified78.5%
if -1.42000000000000007e-33 < x < 1.6500000000000001e-18Initial program 99.4%
+-commutative99.4%
associate-*l*98.9%
fma-define98.9%
sub-neg98.9%
distribute-rgt-in99.0%
metadata-eval99.0%
metadata-eval99.0%
distribute-lft-neg-out99.0%
distribute-rgt-neg-in99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around inf 87.5%
Final simplification82.4%
(FPCore (x y z) :precision binary64 (if (<= z -0.55) (* -6.0 (* (- y x) z)) (if (<= z 0.56) (+ (* y 4.0) (* x -3.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.56) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y - x) * -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 (z <= (-0.55d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.56d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.56) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.55: tmp = -6.0 * ((y - x) * z) elif z <= 0.56: tmp = (y * 4.0) + (x * -3.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.55) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.56) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.55) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.56) tmp = (y * 4.0) + (x * -3.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.55], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.56], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.55:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.55000000000000004Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
if -0.55000000000000004 < z < 0.56000000000000005Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.6%
if 0.56000000000000005 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.8%
Taylor expanded in z around inf 99.0%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.65) (* -6.0 (* (- y x) z)) (if (<= z 0.56) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.56) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -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 (z <= (-0.65d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.56d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.56) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.65: tmp = -6.0 * ((y - x) * z) elif z <= 0.56: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.65) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.56) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.65) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.56) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.65], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.56], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.650000000000000022Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
if -0.650000000000000022 < z < 0.56000000000000005Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.6%
if 0.56000000000000005 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.8%
Taylor expanded in z around inf 99.0%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -6e-26) (not (<= x 1.08e-18))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6e-26) || !(x <= 1.08e-18)) {
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 <= (-6d-26)) .or. (.not. (x <= 1.08d-18))) 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 <= -6e-26) || !(x <= 1.08e-18)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6e-26) or not (x <= 1.08e-18): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6e-26) || !(x <= 1.08e-18)) 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 <= -6e-26) || ~((x <= 1.08e-18))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6e-26], N[Not[LessEqual[x, 1.08e-18]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-26} \lor \neg \left(x \leq 1.08 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -6.00000000000000023e-26 or 1.08e-18 < 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 78.9%
*-lft-identity78.9%
*-commutative78.9%
+-commutative78.9%
*-commutative78.9%
fma-define78.9%
associate-*r*78.9%
fma-define78.9%
distribute-lft-in78.9%
neg-mul-178.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
metadata-eval78.9%
distribute-rgt-in78.8%
+-commutative78.8%
sub-neg78.8%
distribute-rgt-in78.8%
sub-neg78.8%
distribute-rgt-in78.9%
metadata-eval78.9%
distribute-lft-neg-in78.9%
associate-+r+78.9%
Simplified78.9%
Taylor expanded in z around 0 36.1%
*-commutative36.1%
Simplified36.1%
if -6.00000000000000023e-26 < x < 1.08e-18Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 98.7%
Taylor expanded in y around inf 87.4%
associate-*r*87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in z around 0 45.4%
*-commutative45.4%
Simplified45.4%
Final simplification40.2%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.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 * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.4%
fma-define99.4%
sub-neg99.4%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 49.8%
*-lft-identity49.8%
*-commutative49.8%
+-commutative49.8%
*-commutative49.8%
fma-define49.8%
associate-*r*49.8%
fma-define49.8%
distribute-lft-in49.8%
neg-mul-149.8%
distribute-lft-neg-in49.8%
metadata-eval49.8%
metadata-eval49.8%
distribute-rgt-in49.8%
+-commutative49.8%
sub-neg49.8%
distribute-rgt-in49.8%
sub-neg49.8%
distribute-rgt-in49.8%
metadata-eval49.8%
distribute-lft-neg-in49.8%
associate-+r+49.8%
Simplified49.8%
Taylor expanded in z around 0 22.7%
*-commutative22.7%
Simplified22.7%
(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.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around inf 54.4%
Taylor expanded in z around 0 2.7%
herbie shell --seed 2024181
(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))))