
(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 14 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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.5%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.67)
t_0
(if (<= z -1.8e-31)
(* y 4.0)
(if (<= z -3.3e-51)
(* x -3.0)
(if (<= z 4e-207)
(* y 4.0)
(if (<= z 7.5e-75)
(* x -3.0)
(if (<= z 12000000.0)
(* y 4.0)
(if (<= z 2.1e+219) t_0 (* 6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.67) {
tmp = t_0;
} else if (z <= -1.8e-31) {
tmp = y * 4.0;
} else if (z <= -3.3e-51) {
tmp = x * -3.0;
} else if (z <= 4e-207) {
tmp = y * 4.0;
} else if (z <= 7.5e-75) {
tmp = x * -3.0;
} else if (z <= 12000000.0) {
tmp = y * 4.0;
} else if (z <= 2.1e+219) {
tmp = t_0;
} else {
tmp = 6.0 * (x * 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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-0.67d0)) then
tmp = t_0
else if (z <= (-1.8d-31)) then
tmp = y * 4.0d0
else if (z <= (-3.3d-51)) then
tmp = x * (-3.0d0)
else if (z <= 4d-207) then
tmp = y * 4.0d0
else if (z <= 7.5d-75) then
tmp = x * (-3.0d0)
else if (z <= 12000000.0d0) then
tmp = y * 4.0d0
else if (z <= 2.1d+219) then
tmp = t_0
else
tmp = 6.0d0 * (x * z)
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.67) {
tmp = t_0;
} else if (z <= -1.8e-31) {
tmp = y * 4.0;
} else if (z <= -3.3e-51) {
tmp = x * -3.0;
} else if (z <= 4e-207) {
tmp = y * 4.0;
} else if (z <= 7.5e-75) {
tmp = x * -3.0;
} else if (z <= 12000000.0) {
tmp = y * 4.0;
} else if (z <= 2.1e+219) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.67: tmp = t_0 elif z <= -1.8e-31: tmp = y * 4.0 elif z <= -3.3e-51: tmp = x * -3.0 elif z <= 4e-207: tmp = y * 4.0 elif z <= 7.5e-75: tmp = x * -3.0 elif z <= 12000000.0: tmp = y * 4.0 elif z <= 2.1e+219: tmp = t_0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.67) tmp = t_0; elseif (z <= -1.8e-31) tmp = Float64(y * 4.0); elseif (z <= -3.3e-51) tmp = Float64(x * -3.0); elseif (z <= 4e-207) tmp = Float64(y * 4.0); elseif (z <= 7.5e-75) tmp = Float64(x * -3.0); elseif (z <= 12000000.0) tmp = Float64(y * 4.0); elseif (z <= 2.1e+219) tmp = t_0; else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -0.67) tmp = t_0; elseif (z <= -1.8e-31) tmp = y * 4.0; elseif (z <= -3.3e-51) tmp = x * -3.0; elseif (z <= 4e-207) tmp = y * 4.0; elseif (z <= 7.5e-75) tmp = x * -3.0; elseif (z <= 12000000.0) tmp = y * 4.0; elseif (z <= 2.1e+219) tmp = t_0; else tmp = 6.0 * (x * z); 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.67], t$95$0, If[LessEqual[z, -1.8e-31], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.3e-51], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4e-207], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-75], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 12000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.1e+219], t$95$0, N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.67:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-31}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-51}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-75}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 12000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+219}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -0.67000000000000004 or 1.2e7 < z < 2.09999999999999988e219Initial program 99.7%
Taylor expanded in y around inf 55.0%
Taylor expanded in x around 0 54.9%
Taylor expanded in z around inf 53.3%
*-commutative53.3%
Simplified53.3%
if -0.67000000000000004 < z < -1.80000000000000002e-31 or -3.29999999999999973e-51 < z < 3.9999999999999997e-207 or 7.50000000000000017e-75 < z < 1.2e7Initial program 99.4%
Taylor expanded in y around inf 62.9%
Taylor expanded in x around 0 63.4%
Taylor expanded in z around 0 60.8%
if -1.80000000000000002e-31 < z < -3.29999999999999973e-51 or 3.9999999999999997e-207 < z < 7.50000000000000017e-75Initial program 99.5%
Taylor expanded in x around inf 67.2%
*-commutative67.2%
sub-neg67.2%
distribute-lft-in67.2%
metadata-eval67.2%
metadata-eval67.2%
neg-mul-167.2%
*-commutative67.2%
associate-*l*67.2%
distribute-rgt-in67.2%
distribute-lft-in67.2%
associate-+r+67.2%
metadata-eval67.2%
metadata-eval67.2%
metadata-eval67.2%
distribute-lft-in67.2%
+-commutative67.2%
distribute-rgt-in67.2%
*-commutative67.2%
associate-*l*67.2%
metadata-eval67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in z around 0 67.2%
*-commutative67.2%
Simplified67.2%
if 2.09999999999999988e219 < z Initial program 99.8%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
sub-neg65.2%
distribute-lft-in65.2%
metadata-eval65.2%
metadata-eval65.2%
neg-mul-165.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-in65.2%
distribute-lft-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-lft-in65.2%
+-commutative65.2%
distribute-rgt-in65.2%
*-commutative65.2%
associate-*l*65.2%
metadata-eval65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 65.1%
Final simplification59.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.67)
t_0
(if (<= z -2.7e-32)
(* y 4.0)
(if (<= z -1.06e-60)
(* x -3.0)
(if (<= z 1.9e-207)
(* y 4.0)
(if (<= z 1.15e-75)
(* x -3.0)
(if (<= z 12000000.0)
(* y 4.0)
(if (<= z 1.35e+219) t_0 (* x (* 6.0 z)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.67) {
tmp = t_0;
} else if (z <= -2.7e-32) {
tmp = y * 4.0;
} else if (z <= -1.06e-60) {
tmp = x * -3.0;
} else if (z <= 1.9e-207) {
tmp = y * 4.0;
} else if (z <= 1.15e-75) {
tmp = x * -3.0;
} else if (z <= 12000000.0) {
tmp = y * 4.0;
} else if (z <= 1.35e+219) {
tmp = t_0;
} else {
tmp = x * (6.0 * 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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-0.67d0)) then
tmp = t_0
else if (z <= (-2.7d-32)) then
tmp = y * 4.0d0
else if (z <= (-1.06d-60)) then
tmp = x * (-3.0d0)
else if (z <= 1.9d-207) then
tmp = y * 4.0d0
else if (z <= 1.15d-75) then
tmp = x * (-3.0d0)
else if (z <= 12000000.0d0) then
tmp = y * 4.0d0
else if (z <= 1.35d+219) then
tmp = t_0
else
tmp = x * (6.0d0 * z)
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.67) {
tmp = t_0;
} else if (z <= -2.7e-32) {
tmp = y * 4.0;
} else if (z <= -1.06e-60) {
tmp = x * -3.0;
} else if (z <= 1.9e-207) {
tmp = y * 4.0;
} else if (z <= 1.15e-75) {
tmp = x * -3.0;
} else if (z <= 12000000.0) {
tmp = y * 4.0;
} else if (z <= 1.35e+219) {
tmp = t_0;
} else {
tmp = x * (6.0 * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.67: tmp = t_0 elif z <= -2.7e-32: tmp = y * 4.0 elif z <= -1.06e-60: tmp = x * -3.0 elif z <= 1.9e-207: tmp = y * 4.0 elif z <= 1.15e-75: tmp = x * -3.0 elif z <= 12000000.0: tmp = y * 4.0 elif z <= 1.35e+219: tmp = t_0 else: tmp = x * (6.0 * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.67) tmp = t_0; elseif (z <= -2.7e-32) tmp = Float64(y * 4.0); elseif (z <= -1.06e-60) tmp = Float64(x * -3.0); elseif (z <= 1.9e-207) tmp = Float64(y * 4.0); elseif (z <= 1.15e-75) tmp = Float64(x * -3.0); elseif (z <= 12000000.0) tmp = Float64(y * 4.0); elseif (z <= 1.35e+219) tmp = t_0; else tmp = Float64(x * Float64(6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -0.67) tmp = t_0; elseif (z <= -2.7e-32) tmp = y * 4.0; elseif (z <= -1.06e-60) tmp = x * -3.0; elseif (z <= 1.9e-207) tmp = y * 4.0; elseif (z <= 1.15e-75) tmp = x * -3.0; elseif (z <= 12000000.0) tmp = y * 4.0; elseif (z <= 1.35e+219) tmp = t_0; else tmp = x * (6.0 * z); 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.67], t$95$0, If[LessEqual[z, -2.7e-32], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.06e-60], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.9e-207], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.15e-75], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 12000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e+219], t$95$0, N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.67:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-32}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-60}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-75}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 12000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+219}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\end{array}
\end{array}
if z < -0.67000000000000004 or 1.2e7 < z < 1.3499999999999999e219Initial program 99.7%
Taylor expanded in y around inf 55.0%
Taylor expanded in x around 0 54.9%
Taylor expanded in z around inf 53.3%
*-commutative53.3%
Simplified53.3%
if -0.67000000000000004 < z < -2.69999999999999981e-32 or -1.06e-60 < z < 1.9e-207 or 1.15e-75 < z < 1.2e7Initial program 99.4%
Taylor expanded in y around inf 62.9%
Taylor expanded in x around 0 63.4%
Taylor expanded in z around 0 60.8%
if -2.69999999999999981e-32 < z < -1.06e-60 or 1.9e-207 < z < 1.15e-75Initial program 99.5%
Taylor expanded in x around inf 67.2%
*-commutative67.2%
sub-neg67.2%
distribute-lft-in67.2%
metadata-eval67.2%
metadata-eval67.2%
neg-mul-167.2%
*-commutative67.2%
associate-*l*67.2%
distribute-rgt-in67.2%
distribute-lft-in67.2%
associate-+r+67.2%
metadata-eval67.2%
metadata-eval67.2%
metadata-eval67.2%
distribute-lft-in67.2%
+-commutative67.2%
distribute-rgt-in67.2%
*-commutative67.2%
associate-*l*67.2%
metadata-eval67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in z around 0 67.2%
*-commutative67.2%
Simplified67.2%
if 1.3499999999999999e219 < z Initial program 99.8%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
sub-neg65.2%
distribute-lft-in65.2%
metadata-eval65.2%
metadata-eval65.2%
neg-mul-165.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-in65.2%
distribute-lft-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-lft-in65.2%
+-commutative65.2%
distribute-rgt-in65.2%
*-commutative65.2%
associate-*l*65.2%
metadata-eval65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 65.2%
*-commutative65.2%
Simplified65.2%
Final simplification59.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.67)
t_0
(if (<= z -3.5e-31)
(* y 4.0)
(if (<= z -1.26e-48)
(* x -3.0)
(if (<= z 2.9e-207)
(* y 4.0)
(if (<= z 7.5e-75)
(* x -3.0)
(if (<= z 12000000.0) (* y 4.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.67) {
tmp = t_0;
} else if (z <= -3.5e-31) {
tmp = y * 4.0;
} else if (z <= -1.26e-48) {
tmp = x * -3.0;
} else if (z <= 2.9e-207) {
tmp = y * 4.0;
} else if (z <= 7.5e-75) {
tmp = x * -3.0;
} else if (z <= 12000000.0) {
tmp = y * 4.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.67d0)) then
tmp = t_0
else if (z <= (-3.5d-31)) then
tmp = y * 4.0d0
else if (z <= (-1.26d-48)) then
tmp = x * (-3.0d0)
else if (z <= 2.9d-207) then
tmp = y * 4.0d0
else if (z <= 7.5d-75) then
tmp = x * (-3.0d0)
else if (z <= 12000000.0d0) then
tmp = y * 4.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.67) {
tmp = t_0;
} else if (z <= -3.5e-31) {
tmp = y * 4.0;
} else if (z <= -1.26e-48) {
tmp = x * -3.0;
} else if (z <= 2.9e-207) {
tmp = y * 4.0;
} else if (z <= 7.5e-75) {
tmp = x * -3.0;
} else if (z <= 12000000.0) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.67: tmp = t_0 elif z <= -3.5e-31: tmp = y * 4.0 elif z <= -1.26e-48: tmp = x * -3.0 elif z <= 2.9e-207: tmp = y * 4.0 elif z <= 7.5e-75: tmp = x * -3.0 elif z <= 12000000.0: tmp = y * 4.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.67) tmp = t_0; elseif (z <= -3.5e-31) tmp = Float64(y * 4.0); elseif (z <= -1.26e-48) tmp = Float64(x * -3.0); elseif (z <= 2.9e-207) tmp = Float64(y * 4.0); elseif (z <= 7.5e-75) tmp = Float64(x * -3.0); elseif (z <= 12000000.0) tmp = Float64(y * 4.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.67) tmp = t_0; elseif (z <= -3.5e-31) tmp = y * 4.0; elseif (z <= -1.26e-48) tmp = x * -3.0; elseif (z <= 2.9e-207) tmp = y * 4.0; elseif (z <= 7.5e-75) tmp = x * -3.0; elseif (z <= 12000000.0) tmp = y * 4.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.67], t$95$0, If[LessEqual[z, -3.5e-31], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.26e-48], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.9e-207], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-75], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 12000000.0], N[(y * 4.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.67:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-31}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-48}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-75}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 12000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.67000000000000004 or 1.2e7 < z Initial program 99.7%
Taylor expanded in y around inf 52.4%
Taylor expanded in x around 0 52.2%
Taylor expanded in z around inf 50.9%
*-commutative50.9%
Simplified50.9%
if -0.67000000000000004 < z < -3.49999999999999985e-31 or -1.2599999999999999e-48 < z < 2.90000000000000011e-207 or 7.50000000000000017e-75 < z < 1.2e7Initial program 99.4%
Taylor expanded in y around inf 62.9%
Taylor expanded in x around 0 63.4%
Taylor expanded in z around 0 60.8%
if -3.49999999999999985e-31 < z < -1.2599999999999999e-48 or 2.90000000000000011e-207 < z < 7.50000000000000017e-75Initial program 99.5%
Taylor expanded in x around inf 67.2%
*-commutative67.2%
sub-neg67.2%
distribute-lft-in67.2%
metadata-eval67.2%
metadata-eval67.2%
neg-mul-167.2%
*-commutative67.2%
associate-*l*67.2%
distribute-rgt-in67.2%
distribute-lft-in67.2%
associate-+r+67.2%
metadata-eval67.2%
metadata-eval67.2%
metadata-eval67.2%
distribute-lft-in67.2%
+-commutative67.2%
distribute-rgt-in67.2%
*-commutative67.2%
associate-*l*67.2%
metadata-eval67.2%
metadata-eval67.2%
Simplified67.2%
Taylor expanded in z around 0 67.2%
*-commutative67.2%
Simplified67.2%
Final simplification56.8%
(FPCore (x y z)
:precision binary64
(if (<= z -1.7e-16)
(* y (+ 4.0 (* z -6.0)))
(if (<= z 1.78e-19)
(+ (* y 4.0) (* x -3.0))
(if (<= z 7.8e+219)
(* (- 0.6666666666666666 z) (* y 6.0))
(* x (* 6.0 z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.7e-16) {
tmp = y * (4.0 + (z * -6.0));
} else if (z <= 1.78e-19) {
tmp = (y * 4.0) + (x * -3.0);
} else if (z <= 7.8e+219) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = x * (6.0 * 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.7d-16)) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else if (z <= 1.78d-19) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else if (z <= 7.8d+219) then
tmp = (0.6666666666666666d0 - z) * (y * 6.0d0)
else
tmp = x * (6.0d0 * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.7e-16) {
tmp = y * (4.0 + (z * -6.0));
} else if (z <= 1.78e-19) {
tmp = (y * 4.0) + (x * -3.0);
} else if (z <= 7.8e+219) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = x * (6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.7e-16: tmp = y * (4.0 + (z * -6.0)) elif z <= 1.78e-19: tmp = (y * 4.0) + (x * -3.0) elif z <= 7.8e+219: tmp = (0.6666666666666666 - z) * (y * 6.0) else: tmp = x * (6.0 * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.7e-16) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); elseif (z <= 1.78e-19) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); elseif (z <= 7.8e+219) tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); else tmp = Float64(x * Float64(6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.7e-16) tmp = y * (4.0 + (z * -6.0)); elseif (z <= 1.78e-19) tmp = (y * 4.0) + (x * -3.0); elseif (z <= 7.8e+219) tmp = (0.6666666666666666 - z) * (y * 6.0); else tmp = x * (6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.7e-16], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.78e-19], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+219], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-16}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{elif}\;z \leq 1.78 \cdot 10^{-19}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+219}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\end{array}
\end{array}
if z < -1.7e-16Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 54.6%
if -1.7e-16 < z < 1.78000000000000011e-19Initial program 99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 99.9%
if 1.78000000000000011e-19 < z < 7.7999999999999998e219Initial program 99.7%
Taylor expanded in y around inf 61.0%
Taylor expanded in x around 0 60.1%
associate-*r*60.1%
*-commutative60.1%
Simplified60.1%
if 7.7999999999999998e219 < z Initial program 99.8%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
sub-neg65.2%
distribute-lft-in65.2%
metadata-eval65.2%
metadata-eval65.2%
neg-mul-165.2%
*-commutative65.2%
associate-*l*65.2%
distribute-rgt-in65.2%
distribute-lft-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
metadata-eval65.2%
distribute-lft-in65.2%
+-commutative65.2%
distribute-rgt-in65.2%
*-commutative65.2%
associate-*l*65.2%
metadata-eval65.2%
metadata-eval65.2%
Simplified65.2%
Taylor expanded in z around inf 65.2%
*-commutative65.2%
Simplified65.2%
Final simplification78.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.64) (not (<= z 0.66))) (* z (+ (* x 6.0) (* y -6.0))) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.64) || !(z <= 0.66)) {
tmp = z * ((x * 6.0) + (y * -6.0));
} else {
tmp = (y * 4.0) + (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 ((z <= (-0.64d0)) .or. (.not. (z <= 0.66d0))) then
tmp = z * ((x * 6.0d0) + (y * (-6.0d0)))
else
tmp = (y * 4.0d0) + (x * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.64) || !(z <= 0.66)) {
tmp = z * ((x * 6.0) + (y * -6.0));
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.64) or not (z <= 0.66): tmp = z * ((x * 6.0) + (y * -6.0)) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.64) || !(z <= 0.66)) tmp = Float64(z * Float64(Float64(x * 6.0) + Float64(y * -6.0))); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.64) || ~((z <= 0.66))) tmp = z * ((x * 6.0) + (y * -6.0)); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.64], N[Not[LessEqual[z, 0.66]], $MachinePrecision]], N[(z * N[(N[(x * 6.0), $MachinePrecision] + N[(y * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.64 \lor \neg \left(z \leq 0.66\right):\\
\;\;\;\;z \cdot \left(x \cdot 6 + y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.640000000000000013 or 0.660000000000000031 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 95.8%
Taylor expanded in z around inf 97.1%
if -0.640000000000000013 < z < 0.660000000000000031Initial program 99.4%
Taylor expanded in z around 0 97.7%
Taylor expanded in x around 0 97.7%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= z -0.67) (+ x (* -6.0 (* (- y x) z))) (if (<= z 0.65) (+ (* y 4.0) (* x -3.0)) (* z (+ (* x 6.0) (* y -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.67) {
tmp = x + (-6.0 * ((y - x) * z));
} else if (z <= 0.65) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((x * 6.0) + (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 (z <= (-0.67d0)) then
tmp = x + ((-6.0d0) * ((y - x) * z))
else if (z <= 0.65d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = z * ((x * 6.0d0) + (y * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.67) {
tmp = x + (-6.0 * ((y - x) * z));
} else if (z <= 0.65) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = z * ((x * 6.0) + (y * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.67: tmp = x + (-6.0 * ((y - x) * z)) elif z <= 0.65: tmp = (y * 4.0) + (x * -3.0) else: tmp = z * ((x * 6.0) + (y * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.67) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); elseif (z <= 0.65) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(z * Float64(Float64(x * 6.0) + Float64(y * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.67) tmp = x + (-6.0 * ((y - x) * z)); elseif (z <= 0.65) tmp = (y * 4.0) + (x * -3.0); else tmp = z * ((x * 6.0) + (y * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.67], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x * 6.0), $MachinePrecision] + N[(y * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.67:\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6 + y \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.67000000000000004Initial program 99.7%
Taylor expanded in z around inf 94.8%
if -0.67000000000000004 < z < 0.650000000000000022Initial program 99.4%
Taylor expanded in z around 0 97.7%
Taylor expanded in x around 0 97.7%
if 0.650000000000000022 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 96.8%
Taylor expanded in z around inf 99.1%
Final simplification97.4%
(FPCore (x y z)
:precision binary64
(if (<= x -2.6e+59)
(* x (* 6.0 z))
(if (<= x 5e+106)
(* 6.0 (* y (- 0.6666666666666666 z)))
(if (<= x 3.1e+199) (* 6.0 (* x z)) (* x -3.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.6e+59) {
tmp = x * (6.0 * z);
} else if (x <= 5e+106) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else if (x <= 3.1e+199) {
tmp = 6.0 * (x * 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 <= (-2.6d+59)) then
tmp = x * (6.0d0 * z)
else if (x <= 5d+106) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else if (x <= 3.1d+199) then
tmp = 6.0d0 * (x * 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 <= -2.6e+59) {
tmp = x * (6.0 * z);
} else if (x <= 5e+106) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else if (x <= 3.1e+199) {
tmp = 6.0 * (x * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.6e+59: tmp = x * (6.0 * z) elif x <= 5e+106: tmp = 6.0 * (y * (0.6666666666666666 - z)) elif x <= 3.1e+199: tmp = 6.0 * (x * z) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.6e+59) tmp = Float64(x * Float64(6.0 * z)); elseif (x <= 5e+106) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); elseif (x <= 3.1e+199) tmp = Float64(6.0 * Float64(x * z)); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.6e+59) tmp = x * (6.0 * z); elseif (x <= 5e+106) tmp = 6.0 * (y * (0.6666666666666666 - z)); elseif (x <= 3.1e+199) tmp = 6.0 * (x * z); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.6e+59], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+106], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e+199], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+106}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+199}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -2.59999999999999999e59Initial program 99.6%
Taylor expanded in x around inf 82.7%
*-commutative82.7%
sub-neg82.7%
distribute-lft-in82.7%
metadata-eval82.7%
metadata-eval82.7%
neg-mul-182.7%
*-commutative82.7%
associate-*l*82.7%
distribute-rgt-in82.7%
distribute-lft-in82.7%
associate-+r+82.7%
metadata-eval82.7%
metadata-eval82.7%
metadata-eval82.7%
distribute-lft-in82.7%
+-commutative82.7%
distribute-rgt-in82.7%
*-commutative82.7%
associate-*l*82.7%
metadata-eval82.7%
metadata-eval82.7%
Simplified82.7%
Taylor expanded in z around inf 55.5%
*-commutative55.5%
Simplified55.5%
if -2.59999999999999999e59 < x < 4.9999999999999998e106Initial program 99.6%
Taylor expanded in y around inf 69.7%
Taylor expanded in x around 0 70.0%
if 4.9999999999999998e106 < x < 3.09999999999999986e199Initial program 99.4%
Taylor expanded in x around inf 83.8%
*-commutative83.8%
sub-neg83.8%
distribute-lft-in83.8%
metadata-eval83.8%
metadata-eval83.8%
neg-mul-183.8%
*-commutative83.8%
associate-*l*83.8%
distribute-rgt-in83.8%
distribute-lft-in83.8%
associate-+r+83.8%
metadata-eval83.8%
metadata-eval83.8%
metadata-eval83.8%
distribute-lft-in83.8%
+-commutative83.8%
distribute-rgt-in83.8%
*-commutative83.8%
associate-*l*83.8%
metadata-eval83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in z around inf 54.9%
if 3.09999999999999986e199 < x Initial program 99.3%
Taylor expanded in x around inf 89.5%
*-commutative89.5%
sub-neg89.5%
distribute-lft-in89.5%
metadata-eval89.5%
metadata-eval89.5%
neg-mul-189.5%
*-commutative89.5%
associate-*l*89.5%
distribute-rgt-in89.5%
distribute-lft-in89.5%
associate-+r+89.5%
metadata-eval89.5%
metadata-eval89.5%
metadata-eval89.5%
distribute-lft-in89.5%
+-commutative89.5%
distribute-rgt-in89.5%
*-commutative89.5%
associate-*l*89.5%
metadata-eval89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in z around 0 64.3%
*-commutative64.3%
Simplified64.3%
Final simplification65.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -7000000.0) (not (<= y 3.4e-31))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (+ -3.0 (* 6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7000000.0) || !(y <= 3.4e-31)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (6.0 * 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 ((y <= (-7000000.0d0)) .or. (.not. (y <= 3.4d-31))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * ((-3.0d0) + (6.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7000000.0) || !(y <= 3.4e-31)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (6.0 * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7000000.0) or not (y <= 3.4e-31): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (-3.0 + (6.0 * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7000000.0) || !(y <= 3.4e-31)) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7000000.0) || ~((y <= 3.4e-31))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (-3.0 + (6.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7000000.0], N[Not[LessEqual[y, 3.4e-31]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7000000 \lor \neg \left(y \leq 3.4 \cdot 10^{-31}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\end{array}
\end{array}
if y < -7e6 or 3.4000000000000001e-31 < y Initial program 99.6%
Taylor expanded in y around inf 81.2%
Taylor expanded in x around 0 81.4%
if -7e6 < y < 3.4000000000000001e-31Initial program 99.4%
Taylor expanded in x around inf 75.7%
*-commutative75.7%
sub-neg75.7%
distribute-lft-in75.7%
metadata-eval75.7%
metadata-eval75.7%
neg-mul-175.7%
*-commutative75.7%
associate-*l*75.7%
distribute-rgt-in75.7%
distribute-lft-in75.7%
associate-+r+75.7%
metadata-eval75.7%
metadata-eval75.7%
metadata-eval75.7%
distribute-lft-in75.7%
+-commutative75.7%
distribute-rgt-in75.7%
*-commutative75.7%
associate-*l*75.7%
metadata-eval75.7%
metadata-eval75.7%
Simplified75.7%
Final simplification78.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -1150000.0) (not (<= y 3.3e-31))) (* (- 0.6666666666666666 z) (* y 6.0)) (* x (+ -3.0 (* 6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1150000.0) || !(y <= 3.3e-31)) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = x * (-3.0 + (6.0 * 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 ((y <= (-1150000.0d0)) .or. (.not. (y <= 3.3d-31))) then
tmp = (0.6666666666666666d0 - z) * (y * 6.0d0)
else
tmp = x * ((-3.0d0) + (6.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1150000.0) || !(y <= 3.3e-31)) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = x * (-3.0 + (6.0 * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1150000.0) or not (y <= 3.3e-31): tmp = (0.6666666666666666 - z) * (y * 6.0) else: tmp = x * (-3.0 + (6.0 * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1150000.0) || !(y <= 3.3e-31)) tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); else tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1150000.0) || ~((y <= 3.3e-31))) tmp = (0.6666666666666666 - z) * (y * 6.0); else tmp = x * (-3.0 + (6.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1150000.0], N[Not[LessEqual[y, 3.3e-31]], $MachinePrecision]], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1150000 \lor \neg \left(y \leq 3.3 \cdot 10^{-31}\right):\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\end{array}
\end{array}
if y < -1.15e6 or 3.2999999999999999e-31 < y Initial program 99.6%
Taylor expanded in y around inf 81.2%
Taylor expanded in x around 0 81.4%
associate-*r*81.5%
*-commutative81.5%
Simplified81.5%
if -1.15e6 < y < 3.2999999999999999e-31Initial program 99.4%
Taylor expanded in x around inf 75.7%
*-commutative75.7%
sub-neg75.7%
distribute-lft-in75.7%
metadata-eval75.7%
metadata-eval75.7%
neg-mul-175.7%
*-commutative75.7%
associate-*l*75.7%
distribute-rgt-in75.7%
distribute-lft-in75.7%
associate-+r+75.7%
metadata-eval75.7%
metadata-eval75.7%
metadata-eval75.7%
distribute-lft-in75.7%
+-commutative75.7%
distribute-rgt-in75.7%
*-commutative75.7%
associate-*l*75.7%
metadata-eval75.7%
metadata-eval75.7%
Simplified75.7%
Final simplification78.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -930000000.0) (not (<= y 2.9e-31))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* 6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -930000000.0) || !(y <= 2.9e-31)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (6.0 * 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 ((y <= (-930000000.0d0)) .or. (.not. (y <= 2.9d-31))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((-3.0d0) + (6.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -930000000.0) || !(y <= 2.9e-31)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (6.0 * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -930000000.0) or not (y <= 2.9e-31): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (6.0 * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -930000000.0) || !(y <= 2.9e-31)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -930000000.0) || ~((y <= 2.9e-31))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (6.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -930000000.0], N[Not[LessEqual[y, 2.9e-31]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -930000000 \lor \neg \left(y \leq 2.9 \cdot 10^{-31}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\end{array}
\end{array}
if y < -9.3e8 or 2.9000000000000001e-31 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 81.7%
if -9.3e8 < y < 2.9000000000000001e-31Initial program 99.4%
Taylor expanded in x around inf 75.7%
*-commutative75.7%
sub-neg75.7%
distribute-lft-in75.7%
metadata-eval75.7%
metadata-eval75.7%
neg-mul-175.7%
*-commutative75.7%
associate-*l*75.7%
distribute-rgt-in75.7%
distribute-lft-in75.7%
associate-+r+75.7%
metadata-eval75.7%
metadata-eval75.7%
metadata-eval75.7%
distribute-lft-in75.7%
+-commutative75.7%
distribute-rgt-in75.7%
*-commutative75.7%
associate-*l*75.7%
metadata-eval75.7%
metadata-eval75.7%
Simplified75.7%
Final simplification78.8%
(FPCore (x y z) :precision binary64 (if (<= y -5.8e-9) (* y 4.0) (if (<= y 3.05e-139) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.8e-9) {
tmp = y * 4.0;
} else if (y <= 3.05e-139) {
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 (y <= (-5.8d-9)) then
tmp = y * 4.0d0
else if (y <= 3.05d-139) 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 (y <= -5.8e-9) {
tmp = y * 4.0;
} else if (y <= 3.05e-139) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.8e-9: tmp = y * 4.0 elif y <= 3.05e-139: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.8e-9) tmp = Float64(y * 4.0); elseif (y <= 3.05e-139) 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 (y <= -5.8e-9) tmp = y * 4.0; elseif (y <= 3.05e-139) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.8e-9], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 3.05e-139], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-139}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if y < -5.79999999999999982e-9 or 3.0499999999999999e-139 < y Initial program 99.6%
Taylor expanded in y around inf 75.8%
Taylor expanded in x around 0 76.0%
Taylor expanded in z around 0 41.4%
if -5.79999999999999982e-9 < y < 3.0499999999999999e-139Initial program 99.4%
Taylor expanded in x around inf 78.4%
*-commutative78.4%
sub-neg78.4%
distribute-lft-in78.4%
metadata-eval78.4%
metadata-eval78.4%
neg-mul-178.4%
*-commutative78.4%
associate-*l*78.4%
distribute-rgt-in78.4%
distribute-lft-in78.4%
associate-+r+78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
distribute-lft-in78.4%
+-commutative78.4%
distribute-rgt-in78.4%
*-commutative78.4%
associate-*l*78.4%
metadata-eval78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in z around 0 43.3%
*-commutative43.3%
Simplified43.3%
Final simplification42.2%
(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.5%
Taylor expanded in y around inf 53.7%
Taylor expanded in x around 0 54.0%
Taylor expanded in z around 0 29.0%
Final simplification29.0%
(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%
Taylor expanded in y around inf 53.7%
Taylor expanded in x around inf 2.6%
Final simplification2.6%
herbie shell --seed 2023196
(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))))