
(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 (+ (* 4.0 (- y x)) (+ x (* -6.0 (* (- y x) z)))))
double code(double x, double y, double z) {
return (4.0 * (y - x)) + (x + (-6.0 * ((y - x) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (4.0d0 * (y - x)) + (x + ((-6.0d0) * ((y - x) * z)))
end function
public static double code(double x, double y, double z) {
return (4.0 * (y - x)) + (x + (-6.0 * ((y - x) * z)));
}
def code(x, y, z): return (4.0 * (y - x)) + (x + (-6.0 * ((y - x) * z)))
function code(x, y, z) return Float64(Float64(4.0 * Float64(y - x)) + Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z)))) end
function tmp = code(x, y, z) tmp = (4.0 * (y - x)) + (x + (-6.0 * ((y - x) * z))); end
code[x_, y_, z_] := N[(N[(4.0 * N[(y - x), $MachinePrecision]), $MachinePrecision] + N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot \left(y - x\right) + \left(x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -3.7e-5)
t_0
(if (<= z -3.6e-119)
(* 4.0 y)
(if (<= z -1.5e-181)
(* x -3.0)
(if (<= z -3.2e-275)
(* 4.0 y)
(if (<= z 4.9e-269)
(* x -3.0)
(if (<= z 0.66)
(* 4.0 y)
(if (or (<= z 2.35e+113)
(and (not (<= z 7e+206)) (<= z 7.4e+245)))
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 <= -3.7e-5) {
tmp = t_0;
} else if (z <= -3.6e-119) {
tmp = 4.0 * y;
} else if (z <= -1.5e-181) {
tmp = x * -3.0;
} else if (z <= -3.2e-275) {
tmp = 4.0 * y;
} else if (z <= 4.9e-269) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else if ((z <= 2.35e+113) || (!(z <= 7e+206) && (z <= 7.4e+245))) {
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 <= (-3.7d-5)) then
tmp = t_0
else if (z <= (-3.6d-119)) then
tmp = 4.0d0 * y
else if (z <= (-1.5d-181)) then
tmp = x * (-3.0d0)
else if (z <= (-3.2d-275)) then
tmp = 4.0d0 * y
else if (z <= 4.9d-269) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = 4.0d0 * y
else if ((z <= 2.35d+113) .or. (.not. (z <= 7d+206)) .and. (z <= 7.4d+245)) 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 <= -3.7e-5) {
tmp = t_0;
} else if (z <= -3.6e-119) {
tmp = 4.0 * y;
} else if (z <= -1.5e-181) {
tmp = x * -3.0;
} else if (z <= -3.2e-275) {
tmp = 4.0 * y;
} else if (z <= 4.9e-269) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else if ((z <= 2.35e+113) || (!(z <= 7e+206) && (z <= 7.4e+245))) {
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 <= -3.7e-5: tmp = t_0 elif z <= -3.6e-119: tmp = 4.0 * y elif z <= -1.5e-181: tmp = x * -3.0 elif z <= -3.2e-275: tmp = 4.0 * y elif z <= 4.9e-269: tmp = x * -3.0 elif z <= 0.66: tmp = 4.0 * y elif (z <= 2.35e+113) or (not (z <= 7e+206) and (z <= 7.4e+245)): 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 <= -3.7e-5) tmp = t_0; elseif (z <= -3.6e-119) tmp = Float64(4.0 * y); elseif (z <= -1.5e-181) tmp = Float64(x * -3.0); elseif (z <= -3.2e-275) tmp = Float64(4.0 * y); elseif (z <= 4.9e-269) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(4.0 * y); elseif ((z <= 2.35e+113) || (!(z <= 7e+206) && (z <= 7.4e+245))) 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 <= -3.7e-5) tmp = t_0; elseif (z <= -3.6e-119) tmp = 4.0 * y; elseif (z <= -1.5e-181) tmp = x * -3.0; elseif (z <= -3.2e-275) tmp = 4.0 * y; elseif (z <= 4.9e-269) tmp = x * -3.0; elseif (z <= 0.66) tmp = 4.0 * y; elseif ((z <= 2.35e+113) || (~((z <= 7e+206)) && (z <= 7.4e+245))) 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, -3.7e-5], t$95$0, If[LessEqual[z, -3.6e-119], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, -1.5e-181], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.2e-275], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 4.9e-269], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(4.0 * y), $MachinePrecision], If[Or[LessEqual[z, 2.35e+113], And[N[Not[LessEqual[z, 7e+206]], $MachinePrecision], LessEqual[z, 7.4e+245]]], 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 -3.7 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-119}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-181}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-275}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-269}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+113} \lor \neg \left(z \leq 7 \cdot 10^{+206}\right) \land z \leq 7.4 \cdot 10^{+245}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -3.69999999999999981e-5 or 0.660000000000000031 < z < 2.3499999999999999e113 or 7.00000000000000027e206 < z < 7.4000000000000002e245Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 65.7%
Taylor expanded in z around inf 63.2%
*-commutative63.2%
Simplified63.2%
if -3.69999999999999981e-5 < z < -3.6e-119 or -1.49999999999999987e-181 < z < -3.2e-275 or 4.89999999999999999e-269 < z < 0.660000000000000031Initial program 99.4%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 63.6%
Taylor expanded in z around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -3.6e-119 < z < -1.49999999999999987e-181 or -3.2e-275 < z < 4.89999999999999999e-269Initial program 99.3%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
sub-neg76.7%
distribute-lft-in76.7%
metadata-eval76.7%
metadata-eval76.7%
neg-mul-176.7%
*-commutative76.7%
associate-*l*76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
associate-+r+76.7%
metadata-eval76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-lft-in76.7%
+-commutative76.7%
distribute-rgt-in76.7%
*-commutative76.7%
associate-*l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 76.7%
*-commutative76.7%
Simplified76.7%
if 2.3499999999999999e113 < z < 7.00000000000000027e206 or 7.4000000000000002e245 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in y around 0 83.2%
Final simplification66.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -3.7e-5)
t_0
(if (<= z -2.5e-119)
(* 4.0 y)
(if (<= z -9.2e-182)
(* x -3.0)
(if (<= z -6.5e-275)
(* 4.0 y)
(if (<= z 2.4e-268)
(* x -3.0)
(if (<= z 0.66)
(* 4.0 y)
(if (or (<= z 4.2e+112)
(and (not (<= z 7.5e+206)) (<= z 3.4e+250)))
t_0
(* x (* z 6.0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -3.7e-5) {
tmp = t_0;
} else if (z <= -2.5e-119) {
tmp = 4.0 * y;
} else if (z <= -9.2e-182) {
tmp = x * -3.0;
} else if (z <= -6.5e-275) {
tmp = 4.0 * y;
} else if (z <= 2.4e-268) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else if ((z <= 4.2e+112) || (!(z <= 7.5e+206) && (z <= 3.4e+250))) {
tmp = t_0;
} else {
tmp = x * (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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-3.7d-5)) then
tmp = t_0
else if (z <= (-2.5d-119)) then
tmp = 4.0d0 * y
else if (z <= (-9.2d-182)) then
tmp = x * (-3.0d0)
else if (z <= (-6.5d-275)) then
tmp = 4.0d0 * y
else if (z <= 2.4d-268) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = 4.0d0 * y
else if ((z <= 4.2d+112) .or. (.not. (z <= 7.5d+206)) .and. (z <= 3.4d+250)) then
tmp = t_0
else
tmp = x * (z * 6.0d0)
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 <= -3.7e-5) {
tmp = t_0;
} else if (z <= -2.5e-119) {
tmp = 4.0 * y;
} else if (z <= -9.2e-182) {
tmp = x * -3.0;
} else if (z <= -6.5e-275) {
tmp = 4.0 * y;
} else if (z <= 2.4e-268) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else if ((z <= 4.2e+112) || (!(z <= 7.5e+206) && (z <= 3.4e+250))) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -3.7e-5: tmp = t_0 elif z <= -2.5e-119: tmp = 4.0 * y elif z <= -9.2e-182: tmp = x * -3.0 elif z <= -6.5e-275: tmp = 4.0 * y elif z <= 2.4e-268: tmp = x * -3.0 elif z <= 0.66: tmp = 4.0 * y elif (z <= 4.2e+112) or (not (z <= 7.5e+206) and (z <= 3.4e+250)): tmp = t_0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -3.7e-5) tmp = t_0; elseif (z <= -2.5e-119) tmp = Float64(4.0 * y); elseif (z <= -9.2e-182) tmp = Float64(x * -3.0); elseif (z <= -6.5e-275) tmp = Float64(4.0 * y); elseif (z <= 2.4e-268) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(4.0 * y); elseif ((z <= 4.2e+112) || (!(z <= 7.5e+206) && (z <= 3.4e+250))) tmp = t_0; else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -3.7e-5) tmp = t_0; elseif (z <= -2.5e-119) tmp = 4.0 * y; elseif (z <= -9.2e-182) tmp = x * -3.0; elseif (z <= -6.5e-275) tmp = 4.0 * y; elseif (z <= 2.4e-268) tmp = x * -3.0; elseif (z <= 0.66) tmp = 4.0 * y; elseif ((z <= 4.2e+112) || (~((z <= 7.5e+206)) && (z <= 3.4e+250))) tmp = t_0; else tmp = x * (z * 6.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, -3.7e-5], t$95$0, If[LessEqual[z, -2.5e-119], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, -9.2e-182], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6.5e-275], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 2.4e-268], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(4.0 * y), $MachinePrecision], If[Or[LessEqual[z, 4.2e+112], And[N[Not[LessEqual[z, 7.5e+206]], $MachinePrecision], LessEqual[z, 3.4e+250]]], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-119}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-182}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-275}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-268}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+112} \lor \neg \left(z \leq 7.5 \cdot 10^{+206}\right) \land z \leq 3.4 \cdot 10^{+250}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -3.69999999999999981e-5 or 0.660000000000000031 < z < 4.1999999999999998e112 or 7.49999999999999958e206 < z < 3.39999999999999973e250Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 65.7%
Taylor expanded in z around inf 63.2%
*-commutative63.2%
Simplified63.2%
if -3.69999999999999981e-5 < z < -2.49999999999999996e-119 or -9.1999999999999996e-182 < z < -6.500000000000001e-275 or 2.3999999999999999e-268 < z < 0.660000000000000031Initial program 99.4%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 63.6%
Taylor expanded in z around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -2.49999999999999996e-119 < z < -9.1999999999999996e-182 or -6.500000000000001e-275 < z < 2.3999999999999999e-268Initial program 99.3%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
sub-neg76.7%
distribute-lft-in76.7%
metadata-eval76.7%
metadata-eval76.7%
neg-mul-176.7%
*-commutative76.7%
associate-*l*76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
associate-+r+76.7%
metadata-eval76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-lft-in76.7%
+-commutative76.7%
distribute-rgt-in76.7%
*-commutative76.7%
associate-*l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 76.7%
*-commutative76.7%
Simplified76.7%
if 4.1999999999999998e112 < z < 7.49999999999999958e206 or 3.39999999999999973e250 < z Initial program 99.8%
Taylor expanded in x around inf 83.4%
*-commutative83.4%
sub-neg83.4%
distribute-lft-in83.4%
metadata-eval83.4%
metadata-eval83.4%
neg-mul-183.4%
*-commutative83.4%
associate-*l*83.4%
distribute-rgt-in83.4%
distribute-lft-in83.4%
associate-+r+83.4%
metadata-eval83.4%
metadata-eval83.4%
metadata-eval83.4%
distribute-lft-in83.4%
+-commutative83.4%
distribute-rgt-in83.4%
*-commutative83.4%
associate-*l*83.4%
metadata-eval83.4%
metadata-eval83.4%
Simplified83.4%
Taylor expanded in z around inf 83.4%
Final simplification66.0%
(FPCore (x y z)
:precision binary64
(if (<= z -3.7e-5)
(* -6.0 (* y z))
(if (<= z -9.5e-120)
(* 4.0 y)
(if (<= z -3.3e-182)
(* x -3.0)
(if (<= z -3e-275)
(* 4.0 y)
(if (<= z 1.1e-267)
(* x -3.0)
(if (<= z 0.66)
(* 4.0 y)
(if (or (<= z 1.2e+114)
(and (not (<= z 6.4e+206)) (<= z 2.2e+247)))
(* z (* y -6.0))
(* x (* z 6.0))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.7e-5) {
tmp = -6.0 * (y * z);
} else if (z <= -9.5e-120) {
tmp = 4.0 * y;
} else if (z <= -3.3e-182) {
tmp = x * -3.0;
} else if (z <= -3e-275) {
tmp = 4.0 * y;
} else if (z <= 1.1e-267) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else if ((z <= 1.2e+114) || (!(z <= 6.4e+206) && (z <= 2.2e+247))) {
tmp = z * (y * -6.0);
} else {
tmp = x * (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 <= (-3.7d-5)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-9.5d-120)) then
tmp = 4.0d0 * y
else if (z <= (-3.3d-182)) then
tmp = x * (-3.0d0)
else if (z <= (-3d-275)) then
tmp = 4.0d0 * y
else if (z <= 1.1d-267) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = 4.0d0 * y
else if ((z <= 1.2d+114) .or. (.not. (z <= 6.4d+206)) .and. (z <= 2.2d+247)) then
tmp = z * (y * (-6.0d0))
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.7e-5) {
tmp = -6.0 * (y * z);
} else if (z <= -9.5e-120) {
tmp = 4.0 * y;
} else if (z <= -3.3e-182) {
tmp = x * -3.0;
} else if (z <= -3e-275) {
tmp = 4.0 * y;
} else if (z <= 1.1e-267) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else if ((z <= 1.2e+114) || (!(z <= 6.4e+206) && (z <= 2.2e+247))) {
tmp = z * (y * -6.0);
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.7e-5: tmp = -6.0 * (y * z) elif z <= -9.5e-120: tmp = 4.0 * y elif z <= -3.3e-182: tmp = x * -3.0 elif z <= -3e-275: tmp = 4.0 * y elif z <= 1.1e-267: tmp = x * -3.0 elif z <= 0.66: tmp = 4.0 * y elif (z <= 1.2e+114) or (not (z <= 6.4e+206) and (z <= 2.2e+247)): tmp = z * (y * -6.0) else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.7e-5) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -9.5e-120) tmp = Float64(4.0 * y); elseif (z <= -3.3e-182) tmp = Float64(x * -3.0); elseif (z <= -3e-275) tmp = Float64(4.0 * y); elseif (z <= 1.1e-267) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(4.0 * y); elseif ((z <= 1.2e+114) || (!(z <= 6.4e+206) && (z <= 2.2e+247))) tmp = Float64(z * Float64(y * -6.0)); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.7e-5) tmp = -6.0 * (y * z); elseif (z <= -9.5e-120) tmp = 4.0 * y; elseif (z <= -3.3e-182) tmp = x * -3.0; elseif (z <= -3e-275) tmp = 4.0 * y; elseif (z <= 1.1e-267) tmp = x * -3.0; elseif (z <= 0.66) tmp = 4.0 * y; elseif ((z <= 1.2e+114) || (~((z <= 6.4e+206)) && (z <= 2.2e+247))) tmp = z * (y * -6.0); else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.7e-5], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-120], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, -3.3e-182], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3e-275], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 1.1e-267], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(4.0 * y), $MachinePrecision], If[Or[LessEqual[z, 1.2e+114], And[N[Not[LessEqual[z, 6.4e+206]], $MachinePrecision], LessEqual[z, 2.2e+247]]], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-120}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-182}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-275}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-267}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+114} \lor \neg \left(z \leq 6.4 \cdot 10^{+206}\right) \land z \leq 2.2 \cdot 10^{+247}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -3.69999999999999981e-5Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 62.3%
Taylor expanded in z around inf 59.9%
*-commutative59.9%
Simplified59.9%
if -3.69999999999999981e-5 < z < -9.49999999999999937e-120 or -3.29999999999999996e-182 < z < -3e-275 or 1.09999999999999994e-267 < z < 0.660000000000000031Initial program 99.4%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 63.6%
Taylor expanded in z around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -9.49999999999999937e-120 < z < -3.29999999999999996e-182 or -3e-275 < z < 1.09999999999999994e-267Initial program 99.3%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
sub-neg76.7%
distribute-lft-in76.7%
metadata-eval76.7%
metadata-eval76.7%
neg-mul-176.7%
*-commutative76.7%
associate-*l*76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
associate-+r+76.7%
metadata-eval76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-lft-in76.7%
+-commutative76.7%
distribute-rgt-in76.7%
*-commutative76.7%
associate-*l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 76.7%
*-commutative76.7%
Simplified76.7%
if 0.660000000000000031 < z < 1.2e114 or 6.40000000000000011e206 < z < 2.20000000000000011e247Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 95.9%
Taylor expanded in y around inf 71.3%
associate-*r*71.4%
Simplified71.4%
if 1.2e114 < z < 6.40000000000000011e206 or 2.20000000000000011e247 < z Initial program 99.8%
Taylor expanded in x around inf 83.4%
*-commutative83.4%
sub-neg83.4%
distribute-lft-in83.4%
metadata-eval83.4%
metadata-eval83.4%
neg-mul-183.4%
*-commutative83.4%
associate-*l*83.4%
distribute-rgt-in83.4%
distribute-lft-in83.4%
associate-+r+83.4%
metadata-eval83.4%
metadata-eval83.4%
metadata-eval83.4%
distribute-lft-in83.4%
+-commutative83.4%
distribute-rgt-in83.4%
*-commutative83.4%
associate-*l*83.4%
metadata-eval83.4%
metadata-eval83.4%
Simplified83.4%
Taylor expanded in z around inf 83.4%
Final simplification66.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -3.6e-5)
t_0
(if (<= z -4e-119)
(* 4.0 y)
(if (<= z -4.4e-182)
(* x -3.0)
(if (<= z -3.8e-275)
(* 4.0 y)
(if (<= z 5e-269) (* x -3.0) (if (<= z 0.5) (* 4.0 y) t_0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -3.6e-5) {
tmp = t_0;
} else if (z <= -4e-119) {
tmp = 4.0 * y;
} else if (z <= -4.4e-182) {
tmp = x * -3.0;
} else if (z <= -3.8e-275) {
tmp = 4.0 * y;
} else if (z <= 5e-269) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = 4.0 * y;
} 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 <= (-3.6d-5)) then
tmp = t_0
else if (z <= (-4d-119)) then
tmp = 4.0d0 * y
else if (z <= (-4.4d-182)) then
tmp = x * (-3.0d0)
else if (z <= (-3.8d-275)) then
tmp = 4.0d0 * y
else if (z <= 5d-269) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = 4.0d0 * y
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 <= -3.6e-5) {
tmp = t_0;
} else if (z <= -4e-119) {
tmp = 4.0 * y;
} else if (z <= -4.4e-182) {
tmp = x * -3.0;
} else if (z <= -3.8e-275) {
tmp = 4.0 * y;
} else if (z <= 5e-269) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = 4.0 * y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -3.6e-5: tmp = t_0 elif z <= -4e-119: tmp = 4.0 * y elif z <= -4.4e-182: tmp = x * -3.0 elif z <= -3.8e-275: tmp = 4.0 * y elif z <= 5e-269: tmp = x * -3.0 elif z <= 0.5: tmp = 4.0 * y 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 <= -3.6e-5) tmp = t_0; elseif (z <= -4e-119) tmp = Float64(4.0 * y); elseif (z <= -4.4e-182) tmp = Float64(x * -3.0); elseif (z <= -3.8e-275) tmp = Float64(4.0 * y); elseif (z <= 5e-269) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(4.0 * y); 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 <= -3.6e-5) tmp = t_0; elseif (z <= -4e-119) tmp = 4.0 * y; elseif (z <= -4.4e-182) tmp = x * -3.0; elseif (z <= -3.8e-275) tmp = 4.0 * y; elseif (z <= 5e-269) tmp = x * -3.0; elseif (z <= 0.5) tmp = 4.0 * y; 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, -3.6e-5], t$95$0, If[LessEqual[z, -4e-119], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, -4.4e-182], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.8e-275], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 5e-269], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(4.0 * y), $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 -3.6 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-119}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-182}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-275}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-269}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;4 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.60000000000000009e-5 or 0.5 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 96.3%
if -3.60000000000000009e-5 < z < -4.00000000000000005e-119 or -4.3999999999999999e-182 < z < -3.79999999999999972e-275 or 4.99999999999999979e-269 < z < 0.5Initial program 99.4%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 63.6%
Taylor expanded in z around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -4.00000000000000005e-119 < z < -4.3999999999999999e-182 or -3.79999999999999972e-275 < z < 4.99999999999999979e-269Initial program 99.3%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
sub-neg76.7%
distribute-lft-in76.7%
metadata-eval76.7%
metadata-eval76.7%
neg-mul-176.7%
*-commutative76.7%
associate-*l*76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
associate-+r+76.7%
metadata-eval76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-lft-in76.7%
+-commutative76.7%
distribute-rgt-in76.7%
*-commutative76.7%
associate-*l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 76.7%
*-commutative76.7%
Simplified76.7%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* -6.0 (* (- y x) z))))
(if (<= z -4.1e+14)
t_1
(if (<= z -4e-119)
t_0
(if (<= z -1.75e-181)
(* x -3.0)
(if (<= z -8.5e-275)
(* 4.0 y)
(if (<= z 4.2e-269)
(* x -3.0)
(if (<= z 145000000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.1e+14) {
tmp = t_1;
} else if (z <= -4e-119) {
tmp = t_0;
} else if (z <= -1.75e-181) {
tmp = x * -3.0;
} else if (z <= -8.5e-275) {
tmp = 4.0 * y;
} else if (z <= 4.2e-269) {
tmp = x * -3.0;
} else if (z <= 145000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-4.1d+14)) then
tmp = t_1
else if (z <= (-4d-119)) then
tmp = t_0
else if (z <= (-1.75d-181)) then
tmp = x * (-3.0d0)
else if (z <= (-8.5d-275)) then
tmp = 4.0d0 * y
else if (z <= 4.2d-269) then
tmp = x * (-3.0d0)
else if (z <= 145000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.1e+14) {
tmp = t_1;
} else if (z <= -4e-119) {
tmp = t_0;
} else if (z <= -1.75e-181) {
tmp = x * -3.0;
} else if (z <= -8.5e-275) {
tmp = 4.0 * y;
} else if (z <= 4.2e-269) {
tmp = x * -3.0;
} else if (z <= 145000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -4.1e+14: tmp = t_1 elif z <= -4e-119: tmp = t_0 elif z <= -1.75e-181: tmp = x * -3.0 elif z <= -8.5e-275: tmp = 4.0 * y elif z <= 4.2e-269: tmp = x * -3.0 elif z <= 145000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -4.1e+14) tmp = t_1; elseif (z <= -4e-119) tmp = t_0; elseif (z <= -1.75e-181) tmp = Float64(x * -3.0); elseif (z <= -8.5e-275) tmp = Float64(4.0 * y); elseif (z <= 4.2e-269) tmp = Float64(x * -3.0); elseif (z <= 145000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -4.1e+14) tmp = t_1; elseif (z <= -4e-119) tmp = t_0; elseif (z <= -1.75e-181) tmp = x * -3.0; elseif (z <= -8.5e-275) tmp = 4.0 * y; elseif (z <= 4.2e-269) tmp = x * -3.0; elseif (z <= 145000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+14], t$95$1, If[LessEqual[z, -4e-119], t$95$0, If[LessEqual[z, -1.75e-181], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8.5e-275], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 4.2e-269], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 145000000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-181}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-275}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-269}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 145000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.1e14 or 1.45e8 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.6%
if -4.1e14 < z < -4.00000000000000005e-119 or 4.20000000000000009e-269 < z < 1.45e8Initial program 99.5%
Taylor expanded in y around inf 63.2%
Taylor expanded in x around 0 63.9%
if -4.00000000000000005e-119 < z < -1.74999999999999998e-181 or -8.49999999999999952e-275 < z < 4.20000000000000009e-269Initial program 99.3%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
sub-neg76.7%
distribute-lft-in76.7%
metadata-eval76.7%
metadata-eval76.7%
neg-mul-176.7%
*-commutative76.7%
associate-*l*76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
associate-+r+76.7%
metadata-eval76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-lft-in76.7%
+-commutative76.7%
distribute-rgt-in76.7%
*-commutative76.7%
associate-*l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 76.7%
*-commutative76.7%
Simplified76.7%
if -1.74999999999999998e-181 < z < -8.49999999999999952e-275Initial program 99.1%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 67.8%
Taylor expanded in z around 0 67.8%
*-commutative67.8%
Simplified67.8%
Final simplification83.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -3.7e-5)
t_0
(if (<= z -1e-119)
(* 4.0 y)
(if (<= z -4.7e-181)
(* x -3.0)
(if (<= z -3.2e-275)
(* 4.0 y)
(if (<= z 7.6e-269) (* x -3.0) (if (<= z 0.66) (* 4.0 y) t_0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -3.7e-5) {
tmp = t_0;
} else if (z <= -1e-119) {
tmp = 4.0 * y;
} else if (z <= -4.7e-181) {
tmp = x * -3.0;
} else if (z <= -3.2e-275) {
tmp = 4.0 * y;
} else if (z <= 7.6e-269) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} 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 <= (-3.7d-5)) then
tmp = t_0
else if (z <= (-1d-119)) then
tmp = 4.0d0 * y
else if (z <= (-4.7d-181)) then
tmp = x * (-3.0d0)
else if (z <= (-3.2d-275)) then
tmp = 4.0d0 * y
else if (z <= 7.6d-269) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = 4.0d0 * y
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 <= -3.7e-5) {
tmp = t_0;
} else if (z <= -1e-119) {
tmp = 4.0 * y;
} else if (z <= -4.7e-181) {
tmp = x * -3.0;
} else if (z <= -3.2e-275) {
tmp = 4.0 * y;
} else if (z <= 7.6e-269) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = 4.0 * y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -3.7e-5: tmp = t_0 elif z <= -1e-119: tmp = 4.0 * y elif z <= -4.7e-181: tmp = x * -3.0 elif z <= -3.2e-275: tmp = 4.0 * y elif z <= 7.6e-269: tmp = x * -3.0 elif z <= 0.66: tmp = 4.0 * y else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -3.7e-5) tmp = t_0; elseif (z <= -1e-119) tmp = Float64(4.0 * y); elseif (z <= -4.7e-181) tmp = Float64(x * -3.0); elseif (z <= -3.2e-275) tmp = Float64(4.0 * y); elseif (z <= 7.6e-269) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(4.0 * y); 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 <= -3.7e-5) tmp = t_0; elseif (z <= -1e-119) tmp = 4.0 * y; elseif (z <= -4.7e-181) tmp = x * -3.0; elseif (z <= -3.2e-275) tmp = 4.0 * y; elseif (z <= 7.6e-269) tmp = x * -3.0; elseif (z <= 0.66) tmp = 4.0 * y; 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, -3.7e-5], t$95$0, If[LessEqual[z, -1e-119], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, -4.7e-181], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.2e-275], N[(4.0 * y), $MachinePrecision], If[LessEqual[z, 7.6e-269], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(4.0 * y), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-119}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-181}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-275}:\\
\;\;\;\;4 \cdot y\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-269}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;4 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.69999999999999981e-5 or 0.660000000000000031 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 56.8%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -3.69999999999999981e-5 < z < -1.00000000000000001e-119 or -4.6999999999999998e-181 < z < -3.2e-275 or 7.6000000000000005e-269 < z < 0.660000000000000031Initial program 99.4%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 63.6%
Taylor expanded in z around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -1.00000000000000001e-119 < z < -4.6999999999999998e-181 or -3.2e-275 < z < 7.6000000000000005e-269Initial program 99.3%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
sub-neg76.7%
distribute-lft-in76.7%
metadata-eval76.7%
metadata-eval76.7%
neg-mul-176.7%
*-commutative76.7%
associate-*l*76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
associate-+r+76.7%
metadata-eval76.7%
metadata-eval76.7%
metadata-eval76.7%
distribute-lft-in76.7%
+-commutative76.7%
distribute-rgt-in76.7%
*-commutative76.7%
associate-*l*76.7%
metadata-eval76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 76.7%
*-commutative76.7%
Simplified76.7%
Final simplification59.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -3.6e+40)
t_1
(if (<= x -20000.0)
t_0
(if (<= x -3.8e-54)
(* -6.0 (* (- y x) z))
(if (<= x 51000000000.0) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -3.6e+40) {
tmp = t_1;
} else if (x <= -20000.0) {
tmp = t_0;
} else if (x <= -3.8e-54) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 51000000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
t_1 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-3.6d+40)) then
tmp = t_1
else if (x <= (-20000.0d0)) then
tmp = t_0
else if (x <= (-3.8d-54)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (x <= 51000000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -3.6e+40) {
tmp = t_1;
} else if (x <= -20000.0) {
tmp = t_0;
} else if (x <= -3.8e-54) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 51000000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -3.6e+40: tmp = t_1 elif x <= -20000.0: tmp = t_0 elif x <= -3.8e-54: tmp = -6.0 * ((y - x) * z) elif x <= 51000000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -3.6e+40) tmp = t_1; elseif (x <= -20000.0) tmp = t_0; elseif (x <= -3.8e-54) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (x <= 51000000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -3.6e+40) tmp = t_1; elseif (x <= -20000.0) tmp = t_0; elseif (x <= -3.8e-54) tmp = -6.0 * ((y - x) * z); elseif (x <= 51000000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+40], t$95$1, If[LessEqual[x, -20000.0], t$95$0, If[LessEqual[x, -3.8e-54], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 51000000000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -20000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-54}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;x \leq 51000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.59999999999999996e40 or 5.1e10 < x Initial program 99.6%
Taylor expanded in x around inf 83.6%
*-commutative83.6%
sub-neg83.6%
distribute-lft-in83.6%
metadata-eval83.6%
metadata-eval83.6%
neg-mul-183.6%
*-commutative83.6%
associate-*l*83.6%
distribute-rgt-in83.6%
distribute-lft-in83.6%
associate-+r+83.6%
metadata-eval83.6%
metadata-eval83.6%
metadata-eval83.6%
distribute-lft-in83.6%
+-commutative83.6%
distribute-rgt-in83.6%
*-commutative83.6%
associate-*l*83.6%
metadata-eval83.6%
metadata-eval83.6%
Simplified83.6%
if -3.59999999999999996e40 < x < -2e4 or -3.8000000000000002e-54 < x < 5.1e10Initial program 99.6%
Taylor expanded in y around inf 83.5%
Taylor expanded in x around 0 83.8%
if -2e4 < x < -3.8000000000000002e-54Initial program 99.5%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 90.5%
Final simplification84.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ 4.0 (* -6.0 z)))) (t_1 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -1.55e+41)
t_1
(if (<= x -1100.0)
t_0
(if (<= x -1.4e-54)
(* -6.0 (* (- y x) z))
(if (<= x 31500000000.0) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = y * (4.0 + (-6.0 * z));
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.55e+41) {
tmp = t_1;
} else if (x <= -1100.0) {
tmp = t_0;
} else if (x <= -1.4e-54) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 31500000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = y * (4.0d0 + ((-6.0d0) * z))
t_1 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-1.55d+41)) then
tmp = t_1
else if (x <= (-1100.0d0)) then
tmp = t_0
else if (x <= (-1.4d-54)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (x <= 31500000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (4.0 + (-6.0 * z));
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.55e+41) {
tmp = t_1;
} else if (x <= -1100.0) {
tmp = t_0;
} else if (x <= -1.4e-54) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 31500000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (4.0 + (-6.0 * z)) t_1 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -1.55e+41: tmp = t_1 elif x <= -1100.0: tmp = t_0 elif x <= -1.4e-54: tmp = -6.0 * ((y - x) * z) elif x <= 31500000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(4.0 + Float64(-6.0 * z))) t_1 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -1.55e+41) tmp = t_1; elseif (x <= -1100.0) tmp = t_0; elseif (x <= -1.4e-54) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (x <= 31500000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (4.0 + (-6.0 * z)); t_1 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -1.55e+41) tmp = t_1; elseif (x <= -1100.0) tmp = t_0; elseif (x <= -1.4e-54) tmp = -6.0 * ((y - x) * z); elseif (x <= 31500000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.55e+41], t$95$1, If[LessEqual[x, -1100.0], t$95$0, If[LessEqual[x, -1.4e-54], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 31500000000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(4 + -6 \cdot z\right)\\
t_1 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1100:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-54}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;x \leq 31500000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.55e41 or 3.15e10 < x Initial program 99.6%
Taylor expanded in x around inf 83.6%
*-commutative83.6%
sub-neg83.6%
distribute-lft-in83.6%
metadata-eval83.6%
metadata-eval83.6%
neg-mul-183.6%
*-commutative83.6%
associate-*l*83.6%
distribute-rgt-in83.6%
distribute-lft-in83.6%
associate-+r+83.6%
metadata-eval83.6%
metadata-eval83.6%
metadata-eval83.6%
distribute-lft-in83.6%
+-commutative83.6%
distribute-rgt-in83.6%
*-commutative83.6%
associate-*l*83.6%
metadata-eval83.6%
metadata-eval83.6%
Simplified83.6%
if -1.55e41 < x < -1100 or -1.4000000000000001e-54 < x < 3.15e10Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 84.0%
if -1100 < x < -1.4000000000000001e-54Initial program 99.5%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 90.5%
Final simplification84.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* -6.0 (* (- y x) z)) (if (<= z 0.5) (+ (* x -3.0) (* 4.0 y)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.5) {
tmp = (x * -3.0) + (4.0 * y);
} 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.58d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.5d0) then
tmp = (x * (-3.0d0)) + (4.0d0 * y)
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.58) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.5) {
tmp = (x * -3.0) + (4.0 * y);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = -6.0 * ((y - x) * z) elif z <= 0.5: tmp = (x * -3.0) + (4.0 * y) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.5) tmp = Float64(Float64(x * -3.0) + Float64(4.0 * y)); 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.58) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.5) tmp = (x * -3.0) + (4.0 * y); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(N[(x * -3.0), $MachinePrecision] + N[(4.0 * y), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3 + 4 \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 96.4%
if -0.57999999999999996 < z < 0.5Initial program 99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.0%
if 0.5 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.6%
associate-*r*97.7%
*-commutative97.7%
associate-*l*97.7%
Simplified97.7%
Final simplification97.5%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.6%
Taylor expanded in z around 0 99.6%
neg-mul-199.6%
+-commutative99.6%
sub-neg99.6%
Simplified99.6%
Final simplification99.6%
(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.6%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e+19) (* x -3.0) (if (<= x 3000000000000.0) (* 4.0 y) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e+19) {
tmp = x * -3.0;
} else if (x <= 3000000000000.0) {
tmp = 4.0 * y;
} 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 <= (-3.5d+19)) then
tmp = x * (-3.0d0)
else if (x <= 3000000000000.0d0) then
tmp = 4.0d0 * y
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 <= -3.5e+19) {
tmp = x * -3.0;
} else if (x <= 3000000000000.0) {
tmp = 4.0 * y;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e+19: tmp = x * -3.0 elif x <= 3000000000000.0: tmp = 4.0 * y else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e+19) tmp = Float64(x * -3.0); elseif (x <= 3000000000000.0) tmp = Float64(4.0 * y); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.5e+19) tmp = x * -3.0; elseif (x <= 3000000000000.0) tmp = 4.0 * y; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e+19], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 3000000000000.0], N[(4.0 * y), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+19}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 3000000000000:\\
\;\;\;\;4 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -3.5e19 or 3e12 < x Initial program 99.6%
Taylor expanded in x around inf 81.2%
*-commutative81.2%
sub-neg81.2%
distribute-lft-in81.2%
metadata-eval81.2%
metadata-eval81.2%
neg-mul-181.2%
*-commutative81.2%
associate-*l*81.2%
distribute-rgt-in81.2%
distribute-lft-in81.2%
associate-+r+81.2%
metadata-eval81.2%
metadata-eval81.2%
metadata-eval81.2%
distribute-lft-in81.2%
+-commutative81.2%
distribute-rgt-in81.2%
*-commutative81.2%
associate-*l*81.2%
metadata-eval81.2%
metadata-eval81.2%
Simplified81.2%
Taylor expanded in z around 0 38.2%
*-commutative38.2%
Simplified38.2%
if -3.5e19 < x < 3e12Initial program 99.6%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 79.6%
Taylor expanded in z around 0 40.9%
*-commutative40.9%
Simplified40.9%
Final simplification39.7%
(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.6%
Taylor expanded in x around inf 47.6%
*-commutative47.6%
sub-neg47.6%
distribute-lft-in47.6%
metadata-eval47.6%
metadata-eval47.6%
neg-mul-147.6%
*-commutative47.6%
associate-*l*47.6%
distribute-rgt-in47.6%
distribute-lft-in47.6%
associate-+r+47.6%
metadata-eval47.6%
metadata-eval47.6%
metadata-eval47.6%
distribute-lft-in47.6%
+-commutative47.6%
distribute-rgt-in47.6%
*-commutative47.6%
associate-*l*47.6%
metadata-eval47.6%
metadata-eval47.6%
Simplified47.6%
Taylor expanded in z around 0 23.4%
*-commutative23.4%
Simplified23.4%
Final simplification23.4%
herbie shell --seed 2023229
(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))))