
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
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%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
(if (<= z -1.2e+247)
t_0
(if (<= z -0.5)
t_1
(if (<= z 2.15e-305)
(* x -3.0)
(if (<= z 3.1e-105)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (or (<= z 3.9e+146) (not (<= z 8.2e+175))) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -1.2e+247) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = t_1;
} else if (z <= 2.15e-305) {
tmp = x * -3.0;
} else if (z <= 3.1e-105) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 3.9e+146) || !(z <= 8.2e+175)) {
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 * z)
t_1 = 6.0d0 * (x * z)
if (z <= (-1.2d+247)) then
tmp = t_0
else if (z <= (-0.5d0)) then
tmp = t_1
else if (z <= 2.15d-305) then
tmp = x * (-3.0d0)
else if (z <= 3.1d-105) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if ((z <= 3.9d+146) .or. (.not. (z <= 8.2d+175))) 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 * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -1.2e+247) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = t_1;
} else if (z <= 2.15e-305) {
tmp = x * -3.0;
} else if (z <= 3.1e-105) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 3.9e+146) || !(z <= 8.2e+175)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = 6.0 * (x * z) tmp = 0 if z <= -1.2e+247: tmp = t_0 elif z <= -0.5: tmp = t_1 elif z <= 2.15e-305: tmp = x * -3.0 elif z <= 3.1e-105: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif (z <= 3.9e+146) or not (z <= 8.2e+175): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -1.2e+247) tmp = t_0; elseif (z <= -0.5) tmp = t_1; elseif (z <= 2.15e-305) tmp = Float64(x * -3.0); elseif (z <= 3.1e-105) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif ((z <= 3.9e+146) || !(z <= 8.2e+175)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = 6.0 * (x * z); tmp = 0.0; if (z <= -1.2e+247) tmp = t_0; elseif (z <= -0.5) tmp = t_1; elseif (z <= 2.15e-305) tmp = x * -3.0; elseif (z <= 3.1e-105) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif ((z <= 3.9e+146) || ~((z <= 8.2e+175))) 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 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+247], t$95$0, If[LessEqual[z, -0.5], t$95$1, If[LessEqual[z, 2.15e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.1e-105], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 3.9e+146], N[Not[LessEqual[z, 8.2e+175]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+247}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+146} \lor \neg \left(z \leq 8.2 \cdot 10^{+175}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.2e247 or 0.5 < z < 3.9e146 or 8.19999999999999955e175 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 64.4%
Taylor expanded in z around inf 63.7%
*-commutative63.7%
Simplified63.7%
if -1.2e247 < z < -0.5 or 3.9e146 < z < 8.19999999999999955e175Initial program 99.6%
+-commutative99.6%
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.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around -inf 97.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 69.9%
Taylor expanded in z around inf 68.4%
if -0.5 < z < 2.1500000000000001e-305 or 3.10000000000000014e-105 < z < 0.5Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 96.6%
Taylor expanded in x around inf 55.6%
*-commutative55.6%
Simplified55.6%
if 2.1500000000000001e-305 < z < 3.10000000000000014e-105Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification61.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -4.4e+240)
(* -6.0 (* y z))
(if (<= z -0.5)
t_0
(if (<= z 7.8e-307)
(* x -3.0)
(if (<= z 1.2e-103)
(* y 4.0)
(if (<= z 0.52)
(* x -3.0)
(if (or (<= z 1.05e+147) (not (<= z 2.9e+177)))
(* y (* z -6.0))
t_0))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -4.4e+240) {
tmp = -6.0 * (y * z);
} else if (z <= -0.5) {
tmp = t_0;
} else if (z <= 7.8e-307) {
tmp = x * -3.0;
} else if (z <= 1.2e-103) {
tmp = y * 4.0;
} else if (z <= 0.52) {
tmp = x * -3.0;
} else if ((z <= 1.05e+147) || !(z <= 2.9e+177)) {
tmp = y * (z * -6.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 * (x * z)
if (z <= (-4.4d+240)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= 7.8d-307) then
tmp = x * (-3.0d0)
else if (z <= 1.2d-103) then
tmp = y * 4.0d0
else if (z <= 0.52d0) then
tmp = x * (-3.0d0)
else if ((z <= 1.05d+147) .or. (.not. (z <= 2.9d+177))) then
tmp = y * (z * (-6.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 * (x * z);
double tmp;
if (z <= -4.4e+240) {
tmp = -6.0 * (y * z);
} else if (z <= -0.5) {
tmp = t_0;
} else if (z <= 7.8e-307) {
tmp = x * -3.0;
} else if (z <= 1.2e-103) {
tmp = y * 4.0;
} else if (z <= 0.52) {
tmp = x * -3.0;
} else if ((z <= 1.05e+147) || !(z <= 2.9e+177)) {
tmp = y * (z * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -4.4e+240: tmp = -6.0 * (y * z) elif z <= -0.5: tmp = t_0 elif z <= 7.8e-307: tmp = x * -3.0 elif z <= 1.2e-103: tmp = y * 4.0 elif z <= 0.52: tmp = x * -3.0 elif (z <= 1.05e+147) or not (z <= 2.9e+177): tmp = y * (z * -6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -4.4e+240) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -0.5) tmp = t_0; elseif (z <= 7.8e-307) tmp = Float64(x * -3.0); elseif (z <= 1.2e-103) tmp = Float64(y * 4.0); elseif (z <= 0.52) tmp = Float64(x * -3.0); elseif ((z <= 1.05e+147) || !(z <= 2.9e+177)) tmp = Float64(y * Float64(z * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -4.4e+240) tmp = -6.0 * (y * z); elseif (z <= -0.5) tmp = t_0; elseif (z <= 7.8e-307) tmp = x * -3.0; elseif (z <= 1.2e-103) tmp = y * 4.0; elseif (z <= 0.52) tmp = x * -3.0; elseif ((z <= 1.05e+147) || ~((z <= 2.9e+177))) tmp = y * (z * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+240], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, 7.8e-307], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.2e-103], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 1.05e+147], N[Not[LessEqual[z, 2.9e+177]], $MachinePrecision]], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+240}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-307}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-103}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+147} \lor \neg \left(z \leq 2.9 \cdot 10^{+177}\right):\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.4000000000000003e240Initial program 99.8%
+-commutative99.8%
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-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 70.0%
Taylor expanded in z around inf 70.0%
*-commutative70.0%
Simplified70.0%
if -4.4000000000000003e240 < z < -0.5 or 1.05000000000000003e147 < z < 2.90000000000000013e177Initial program 99.6%
+-commutative99.6%
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.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around -inf 97.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 69.9%
Taylor expanded in z around inf 68.4%
if -0.5 < z < 7.799999999999999e-307 or 1.2000000000000001e-103 < z < 0.52000000000000002Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 96.6%
Taylor expanded in x around inf 55.6%
*-commutative55.6%
Simplified55.6%
if 7.799999999999999e-307 < z < 1.2000000000000001e-103Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 0.52000000000000002 < z < 1.05000000000000003e147 or 2.90000000000000013e177 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 63.2%
Taylor expanded in z around inf 62.4%
Final simplification61.6%
(FPCore (x y z)
:precision binary64
(if (<= z -2.45e+240)
(* -6.0 (* y z))
(if (<= z -0.5)
(* x (* z 6.0))
(if (<= z 4e-305)
(* x -3.0)
(if (<= z 2.4e-104)
(* y 4.0)
(if (<= z 0.58)
(* x -3.0)
(if (or (<= z 4.8e+146) (not (<= z 5.2e+175)))
(* y (* z -6.0))
(* 6.0 (* x z)))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.45e+240) {
tmp = -6.0 * (y * z);
} else if (z <= -0.5) {
tmp = x * (z * 6.0);
} else if (z <= 4e-305) {
tmp = x * -3.0;
} else if (z <= 2.4e-104) {
tmp = y * 4.0;
} else if (z <= 0.58) {
tmp = x * -3.0;
} else if ((z <= 4.8e+146) || !(z <= 5.2e+175)) {
tmp = y * (z * -6.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) :: tmp
if (z <= (-2.45d+240)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-0.5d0)) then
tmp = x * (z * 6.0d0)
else if (z <= 4d-305) then
tmp = x * (-3.0d0)
else if (z <= 2.4d-104) then
tmp = y * 4.0d0
else if (z <= 0.58d0) then
tmp = x * (-3.0d0)
else if ((z <= 4.8d+146) .or. (.not. (z <= 5.2d+175))) then
tmp = y * (z * (-6.0d0))
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.45e+240) {
tmp = -6.0 * (y * z);
} else if (z <= -0.5) {
tmp = x * (z * 6.0);
} else if (z <= 4e-305) {
tmp = x * -3.0;
} else if (z <= 2.4e-104) {
tmp = y * 4.0;
} else if (z <= 0.58) {
tmp = x * -3.0;
} else if ((z <= 4.8e+146) || !(z <= 5.2e+175)) {
tmp = y * (z * -6.0);
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.45e+240: tmp = -6.0 * (y * z) elif z <= -0.5: tmp = x * (z * 6.0) elif z <= 4e-305: tmp = x * -3.0 elif z <= 2.4e-104: tmp = y * 4.0 elif z <= 0.58: tmp = x * -3.0 elif (z <= 4.8e+146) or not (z <= 5.2e+175): tmp = y * (z * -6.0) else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.45e+240) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -0.5) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= 4e-305) tmp = Float64(x * -3.0); elseif (z <= 2.4e-104) tmp = Float64(y * 4.0); elseif (z <= 0.58) tmp = Float64(x * -3.0); elseif ((z <= 4.8e+146) || !(z <= 5.2e+175)) tmp = Float64(y * Float64(z * -6.0)); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.45e+240) tmp = -6.0 * (y * z); elseif (z <= -0.5) tmp = x * (z * 6.0); elseif (z <= 4e-305) tmp = x * -3.0; elseif (z <= 2.4e-104) tmp = y * 4.0; elseif (z <= 0.58) tmp = x * -3.0; elseif ((z <= 4.8e+146) || ~((z <= 5.2e+175))) tmp = y * (z * -6.0); else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.45e+240], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.5], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.4e-104], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.58], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 4.8e+146], N[Not[LessEqual[z, 5.2e+175]], $MachinePrecision]], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+240}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+146} \lor \neg \left(z \leq 5.2 \cdot 10^{+175}\right):\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.45e240Initial program 99.8%
+-commutative99.8%
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-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 70.0%
Taylor expanded in z around inf 70.0%
*-commutative70.0%
Simplified70.0%
if -2.45e240 < z < -0.5Initial program 99.6%
+-commutative99.6%
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 x around -inf 97.4%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around inf 68.3%
Taylor expanded in z around inf 66.5%
*-commutative66.5%
Simplified66.5%
if -0.5 < z < 3.99999999999999999e-305 or 2.4000000000000001e-104 < z < 0.57999999999999996Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 96.6%
Taylor expanded in x around inf 55.6%
*-commutative55.6%
Simplified55.6%
if 3.99999999999999999e-305 < z < 2.4000000000000001e-104Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 0.57999999999999996 < z < 4.8000000000000004e146 or 5.2000000000000001e175 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 63.2%
Taylor expanded in z around inf 62.4%
if 4.8000000000000004e146 < z < 5.2000000000000001e175Initial program 99.8%
+-commutative99.8%
associate-*l*99.6%
fma-def99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
neg-mul-199.6%
associate-*r*99.6%
*-commutative99.6%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around -inf 99.6%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 78.5%
Taylor expanded in z around inf 78.7%
Final simplification61.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.0065)
t_0
(if (<= z 1.2e-305)
(* x -3.0)
(if (<= z 7.6e-107)
(* y 4.0)
(if (<= z 1.35e-12)
(* x -3.0)
(if (<= z 1400000000.0)
(* 6.0 (* y (- 0.6666666666666666 z)))
t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0065) {
tmp = t_0;
} else if (z <= 1.2e-305) {
tmp = x * -3.0;
} else if (z <= 7.6e-107) {
tmp = y * 4.0;
} else if (z <= 1.35e-12) {
tmp = x * -3.0;
} else if (z <= 1400000000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.0065d0)) then
tmp = t_0
else if (z <= 1.2d-305) then
tmp = x * (-3.0d0)
else if (z <= 7.6d-107) then
tmp = y * 4.0d0
else if (z <= 1.35d-12) then
tmp = x * (-3.0d0)
else if (z <= 1400000000.0d0) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0065) {
tmp = t_0;
} else if (z <= 1.2e-305) {
tmp = x * -3.0;
} else if (z <= 7.6e-107) {
tmp = y * 4.0;
} else if (z <= 1.35e-12) {
tmp = x * -3.0;
} else if (z <= 1400000000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.0065: tmp = t_0 elif z <= 1.2e-305: tmp = x * -3.0 elif z <= 7.6e-107: tmp = y * 4.0 elif z <= 1.35e-12: tmp = x * -3.0 elif z <= 1400000000.0: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.0065) tmp = t_0; elseif (z <= 1.2e-305) tmp = Float64(x * -3.0); elseif (z <= 7.6e-107) tmp = Float64(y * 4.0); elseif (z <= 1.35e-12) tmp = Float64(x * -3.0); elseif (z <= 1400000000.0) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.0065) tmp = t_0; elseif (z <= 1.2e-305) tmp = x * -3.0; elseif (z <= 7.6e-107) tmp = y * 4.0; elseif (z <= 1.35e-12) tmp = x * -3.0; elseif (z <= 1400000000.0) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0065], t$95$0, If[LessEqual[z, 1.2e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.6e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-12], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1400000000.0], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.0065:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-12}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1400000000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.0064999999999999997 or 1.4e9 < z Initial program 99.7%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 98.8%
if -0.0064999999999999997 < z < 1.2000000000000001e-305 or 7.6000000000000004e-107 < z < 1.3499999999999999e-12Initial program 99.3%
+-commutative99.3%
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 x around -inf 99.8%
Taylor expanded in z around 0 99.3%
Taylor expanded in x around inf 57.7%
*-commutative57.7%
Simplified57.7%
if 1.2000000000000001e-305 < z < 7.6000000000000004e-107Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 1.3499999999999999e-12 < z < 1.4e9Initial program 98.3%
associate-*r*98.6%
metadata-eval98.6%
+-commutative98.6%
metadata-eval98.6%
*-commutative98.6%
associate-*r*98.6%
fma-def98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 79.9%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (+ (* z (+ (* x 6.0) (* y -6.0))) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
return (z * ((x * 6.0) + (y * -6.0))) + ((x * -3.0) + (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 = (z * ((x * 6.0d0) + (y * (-6.0d0)))) + ((x * (-3.0d0)) + (y * 4.0d0))
end function
public static double code(double x, double y, double z) {
return (z * ((x * 6.0) + (y * -6.0))) + ((x * -3.0) + (y * 4.0));
}
def code(x, y, z): return (z * ((x * 6.0) + (y * -6.0))) + ((x * -3.0) + (y * 4.0))
function code(x, y, z) return Float64(Float64(z * Float64(Float64(x * 6.0) + Float64(y * -6.0))) + Float64(Float64(x * -3.0) + Float64(y * 4.0))) end
function tmp = code(x, y, z) tmp = (z * ((x * 6.0) + (y * -6.0))) + ((x * -3.0) + (y * 4.0)); end
code[x_, y_, z_] := N[(N[(z * N[(N[(x * 6.0), $MachinePrecision] + N[(y * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(x \cdot 6 + y \cdot -6\right) + \left(x \cdot -3 + y \cdot 4\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
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 x around -inf 97.8%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (or (<= y -5.5e+116)
(not (or (<= y -3.9e+32) (and (not (<= y -2.5e-79)) (<= y 1.7e-10)))))
(* 6.0 (* y (- 0.6666666666666666 z)))
(* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e+116) || !((y <= -3.9e+32) || (!(y <= -2.5e-79) && (y <= 1.7e-10)))) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-5.5d+116)) .or. (.not. (y <= (-3.9d+32)) .or. (.not. (y <= (-2.5d-79))) .and. (y <= 1.7d-10))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e+116) || !((y <= -3.9e+32) || (!(y <= -2.5e-79) && (y <= 1.7e-10)))) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.5e+116) or not ((y <= -3.9e+32) or (not (y <= -2.5e-79) and (y <= 1.7e-10))): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.5e+116) || !((y <= -3.9e+32) || (!(y <= -2.5e-79) && (y <= 1.7e-10)))) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.5e+116) || ~(((y <= -3.9e+32) || (~((y <= -2.5e-79)) && (y <= 1.7e-10))))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5e+116], N[Not[Or[LessEqual[y, -3.9e+32], And[N[Not[LessEqual[y, -2.5e-79]], $MachinePrecision], LessEqual[y, 1.7e-10]]]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+116} \lor \neg \left(y \leq -3.9 \cdot 10^{+32} \lor \neg \left(y \leq -2.5 \cdot 10^{-79}\right) \land y \leq 1.7 \cdot 10^{-10}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -5.50000000000000035e116 or -3.8999999999999999e32 < y < -2.5e-79 or 1.70000000000000007e-10 < y Initial program 99.6%
associate-*r*99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
*-commutative99.8%
associate-*r*99.6%
fma-def99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 84.1%
if -5.50000000000000035e116 < y < -3.8999999999999999e32 or -2.5e-79 < y < 1.70000000000000007e-10Initial program 99.4%
+-commutative99.4%
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 x around -inf 99.8%
Taylor expanded in x around inf 79.7%
mul-1-neg79.7%
*-commutative79.7%
+-commutative79.7%
*-commutative79.7%
fma-udef79.7%
distribute-rgt-neg-in79.7%
fma-udef79.7%
distribute-neg-in79.7%
distribute-rgt-neg-in79.7%
metadata-eval79.7%
metadata-eval79.7%
Simplified79.7%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(if (or (<= y -5.5e+116)
(not (or (<= y -2.8e+33) (and (not (<= y -1.5e-79)) (<= y 2.65e-9)))))
(* y (+ 4.0 (* z -6.0)))
(* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e+116) || !((y <= -2.8e+33) || (!(y <= -1.5e-79) && (y <= 2.65e-9)))) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-5.5d+116)) .or. (.not. (y <= (-2.8d+33)) .or. (.not. (y <= (-1.5d-79))) .and. (y <= 2.65d-9))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e+116) || !((y <= -2.8e+33) || (!(y <= -1.5e-79) && (y <= 2.65e-9)))) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.5e+116) or not ((y <= -2.8e+33) or (not (y <= -1.5e-79) and (y <= 2.65e-9))): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.5e+116) || !((y <= -2.8e+33) || (!(y <= -1.5e-79) && (y <= 2.65e-9)))) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.5e+116) || ~(((y <= -2.8e+33) || (~((y <= -1.5e-79)) && (y <= 2.65e-9))))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5e+116], N[Not[Or[LessEqual[y, -2.8e+33], And[N[Not[LessEqual[y, -1.5e-79]], $MachinePrecision], LessEqual[y, 2.65e-9]]]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+116} \lor \neg \left(y \leq -2.8 \cdot 10^{+33} \lor \neg \left(y \leq -1.5 \cdot 10^{-79}\right) \land y \leq 2.65 \cdot 10^{-9}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -5.50000000000000035e116 or -2.8000000000000001e33 < y < -1.5e-79 or 2.65000000000000015e-9 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 84.3%
if -5.50000000000000035e116 < y < -2.8000000000000001e33 or -1.5e-79 < y < 2.65000000000000015e-9Initial program 99.4%
+-commutative99.4%
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 x around -inf 99.8%
Taylor expanded in x around inf 79.7%
mul-1-neg79.7%
*-commutative79.7%
+-commutative79.7%
*-commutative79.7%
fma-udef79.7%
distribute-rgt-neg-in79.7%
fma-udef79.7%
distribute-neg-in79.7%
distribute-rgt-neg-in79.7%
metadata-eval79.7%
metadata-eval79.7%
Simplified79.7%
Final simplification81.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.00155)
t_0
(if (<= z 3.5e-305)
(* x -3.0)
(if (<= z 4.5e-107) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.00155) {
tmp = t_0;
} else if (z <= 3.5e-305) {
tmp = x * -3.0;
} else if (z <= 4.5e-107) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.00155d0)) then
tmp = t_0
else if (z <= 3.5d-305) then
tmp = x * (-3.0d0)
else if (z <= 4.5d-107) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.00155) {
tmp = t_0;
} else if (z <= 3.5e-305) {
tmp = x * -3.0;
} else if (z <= 4.5e-107) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.00155: tmp = t_0 elif z <= 3.5e-305: tmp = x * -3.0 elif z <= 4.5e-107: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.00155) tmp = t_0; elseif (z <= 3.5e-305) tmp = Float64(x * -3.0); elseif (z <= 4.5e-107) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.00155) tmp = t_0; elseif (z <= 3.5e-305) tmp = x * -3.0; elseif (z <= 4.5e-107) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00155], t$95$0, If[LessEqual[z, 3.5e-305], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.00155:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-305}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.00154999999999999995 or 0.5 < z Initial program 99.7%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 98.6%
if -0.00154999999999999995 < z < 3.4999999999999998e-305 or 4.50000000000000016e-107 < z < 0.5Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 96.6%
Taylor expanded in x around inf 55.6%
*-commutative55.6%
Simplified55.6%
if 3.4999999999999998e-305 < z < 4.50000000000000016e-107Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification79.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0))))
(t_1 (* 6.0 (* y (- 0.6666666666666666 z)))))
(if (<= y -5.5e+116)
t_1
(if (<= y -4.5e+32)
t_0
(if (<= y -2.5e-79)
(* (- 0.6666666666666666 z) (* y 6.0))
(if (<= y 1.75e-9) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -5.5e+116) {
tmp = t_1;
} else if (y <= -4.5e+32) {
tmp = t_0;
} else if (y <= -2.5e-79) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else if (y <= 1.75e-9) {
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 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = 6.0d0 * (y * (0.6666666666666666d0 - z))
if (y <= (-5.5d+116)) then
tmp = t_1
else if (y <= (-4.5d+32)) then
tmp = t_0
else if (y <= (-2.5d-79)) then
tmp = (0.6666666666666666d0 - z) * (y * 6.0d0)
else if (y <= 1.75d-9) 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 = x * (-3.0 + (z * 6.0));
double t_1 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -5.5e+116) {
tmp = t_1;
} else if (y <= -4.5e+32) {
tmp = t_0;
} else if (y <= -2.5e-79) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else if (y <= 1.75e-9) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = 6.0 * (y * (0.6666666666666666 - z)) tmp = 0 if y <= -5.5e+116: tmp = t_1 elif y <= -4.5e+32: tmp = t_0 elif y <= -2.5e-79: tmp = (0.6666666666666666 - z) * (y * 6.0) elif y <= 1.75e-9: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) tmp = 0.0 if (y <= -5.5e+116) tmp = t_1; elseif (y <= -4.5e+32) tmp = t_0; elseif (y <= -2.5e-79) tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); elseif (y <= 1.75e-9) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = 6.0 * (y * (0.6666666666666666 - z)); tmp = 0.0; if (y <= -5.5e+116) tmp = t_1; elseif (y <= -4.5e+32) tmp = t_0; elseif (y <= -2.5e-79) tmp = (0.6666666666666666 - z) * (y * 6.0); elseif (y <= 1.75e-9) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+116], t$95$1, If[LessEqual[y, -4.5e+32], t$95$0, If[LessEqual[y, -2.5e-79], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-9], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{+32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-79}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-9}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.50000000000000035e116 or 1.75e-9 < y Initial program 99.6%
associate-*r*99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
*-commutative99.8%
associate-*r*99.7%
fma-def99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 87.5%
if -5.50000000000000035e116 < y < -4.5000000000000003e32 or -2.5e-79 < y < 1.75e-9Initial program 99.4%
+-commutative99.4%
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 x around -inf 99.8%
Taylor expanded in x around inf 79.7%
mul-1-neg79.7%
*-commutative79.7%
+-commutative79.7%
*-commutative79.7%
fma-udef79.7%
distribute-rgt-neg-in79.7%
fma-udef79.7%
distribute-neg-in79.7%
distribute-rgt-neg-in79.7%
metadata-eval79.7%
metadata-eval79.7%
Simplified79.7%
if -4.5000000000000003e32 < y < -2.5e-79Initial program 99.6%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.4%
fma-def99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 70.8%
associate-*r*71.0%
Simplified71.0%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -540000000000.0)
t_0
(if (<= z 1.45e-306)
(* x -3.0)
(if (<= z 3.4e-106) (* y 4.0) (if (<= z 0.6) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -540000000000.0) {
tmp = t_0;
} else if (z <= 1.45e-306) {
tmp = x * -3.0;
} else if (z <= 3.4e-106) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-540000000000.0d0)) then
tmp = t_0
else if (z <= 1.45d-306) then
tmp = x * (-3.0d0)
else if (z <= 3.4d-106) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -540000000000.0) {
tmp = t_0;
} else if (z <= 1.45e-306) {
tmp = x * -3.0;
} else if (z <= 3.4e-106) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -540000000000.0: tmp = t_0 elif z <= 1.45e-306: tmp = x * -3.0 elif z <= 3.4e-106: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -540000000000.0) tmp = t_0; elseif (z <= 1.45e-306) tmp = Float64(x * -3.0); elseif (z <= 3.4e-106) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -540000000000.0) tmp = t_0; elseif (z <= 1.45e-306) tmp = x * -3.0; elseif (z <= 3.4e-106) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -540000000000.0], t$95$0, If[LessEqual[z, 1.45e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.4e-106], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -540000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-306}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-106}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -5.4e11 or 0.599999999999999978 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 53.1%
Taylor expanded in z around inf 52.6%
*-commutative52.6%
Simplified52.6%
if -5.4e11 < z < 1.4499999999999999e-306 or 3.39999999999999982e-106 < z < 0.599999999999999978Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 94.5%
Taylor expanded in x around inf 54.5%
*-commutative54.5%
Simplified54.5%
if 1.4499999999999999e-306 < z < 3.39999999999999982e-106Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification54.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* -6.0 (* (- y x) z)) (if (<= z 0.52) (+ (* x -3.0) (* y 4.0)) (* z (+ (* x 6.0) (* y -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.52) {
tmp = (x * -3.0) + (y * 4.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.6d0)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (z <= 0.52d0) then
tmp = (x * (-3.0d0)) + (y * 4.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.6) {
tmp = -6.0 * ((y - x) * z);
} else if (z <= 0.52) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((x * 6.0) + (y * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = -6.0 * ((y - x) * z) elif z <= 0.52: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * ((x * 6.0) + (y * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (z <= 0.52) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.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.6) tmp = -6.0 * ((y - x) * z); elseif (z <= 0.52) tmp = (x * -3.0) + (y * 4.0); else tmp = z * ((x * 6.0) + (y * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.52], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.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.6:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6 + y \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.7%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.8%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 98.5%
if -0.599999999999999978 < z < 0.52000000000000002Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 97.7%
if 0.52000000000000002 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around -inf 94.9%
Taylor expanded in z around inf 98.7%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.52))) (* -6.0 (* (- y x) z)) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.52)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = (x * -3.0) + (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 ((z <= (-0.6d0)) .or. (.not. (z <= 0.52d0))) then
tmp = (-6.0d0) * ((y - x) * z)
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.52)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.52): tmp = -6.0 * ((y - x) * z) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.52)) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.6) || ~((z <= 0.52))) tmp = -6.0 * ((y - x) * z); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.52]], $MachinePrecision]], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.52\right):\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.52000000000000002 < z Initial program 99.7%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 98.6%
if -0.599999999999999978 < z < 0.52000000000000002Initial program 99.2%
+-commutative99.2%
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 x around -inf 99.8%
Taylor expanded in z around 0 97.7%
Final simplification98.2%
(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.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (<= y -8.6e-75) (* y 4.0) (if (<= y 1.65e-10) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -8.6e-75) {
tmp = y * 4.0;
} else if (y <= 1.65e-10) {
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 <= (-8.6d-75)) then
tmp = y * 4.0d0
else if (y <= 1.65d-10) 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 <= -8.6e-75) {
tmp = y * 4.0;
} else if (y <= 1.65e-10) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8.6e-75: tmp = y * 4.0 elif y <= 1.65e-10: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8.6e-75) tmp = Float64(y * 4.0); elseif (y <= 1.65e-10) 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 <= -8.6e-75) tmp = y * 4.0; elseif (y <= 1.65e-10) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8.6e-75], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 1.65e-10], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-10}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if y < -8.5999999999999998e-75 or 1.65e-10 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 78.8%
Taylor expanded in z around 0 34.9%
*-commutative34.9%
Simplified34.9%
if -8.5999999999999998e-75 < y < 1.65e-10Initial program 99.3%
+-commutative99.3%
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 x around -inf 99.7%
Taylor expanded in z around 0 49.7%
Taylor expanded in x around inf 42.5%
*-commutative42.5%
Simplified42.5%
Final simplification38.5%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.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 x around -inf 97.8%
Taylor expanded in z around 0 45.5%
Taylor expanded in x around inf 24.4%
*-commutative24.4%
Simplified24.4%
Final simplification24.4%
(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 z around inf 55.5%
Taylor expanded in z around 0 2.6%
Final simplification2.6%
herbie shell --seed 2023221
(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))))