
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (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.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%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (* 6.0 (- 0.6666666666666666 z)) x))
double code(double x, double y, double z) {
return fma((y - x), (6.0 * (0.6666666666666666 - z)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(6.0 * Float64(0.6666666666666666 - z)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.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 -5.4e+233)
t_0
(if (<= z -1.15e-15)
t_1
(if (<= z 2.55e-295)
(* x -3.0)
(if (<= z 0.6) (* y 4.0) (if (<= z 6e+105) t_1 t_0)))))))
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 <= -5.4e+233) {
tmp = t_0;
} else if (z <= -1.15e-15) {
tmp = t_1;
} else if (z <= 2.55e-295) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 6e+105) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = 6.0d0 * (x * z)
if (z <= (-5.4d+233)) then
tmp = t_0
else if (z <= (-1.15d-15)) then
tmp = t_1
else if (z <= 2.55d-295) then
tmp = x * (-3.0d0)
else if (z <= 0.6d0) then
tmp = y * 4.0d0
else if (z <= 6d+105) then
tmp = t_1
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 t_1 = 6.0 * (x * z);
double tmp;
if (z <= -5.4e+233) {
tmp = t_0;
} else if (z <= -1.15e-15) {
tmp = t_1;
} else if (z <= 2.55e-295) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 6e+105) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = 6.0 * (x * z) tmp = 0 if z <= -5.4e+233: tmp = t_0 elif z <= -1.15e-15: tmp = t_1 elif z <= 2.55e-295: tmp = x * -3.0 elif z <= 0.6: tmp = y * 4.0 elif z <= 6e+105: tmp = t_1 else: tmp = t_0 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 <= -5.4e+233) tmp = t_0; elseif (z <= -1.15e-15) tmp = t_1; elseif (z <= 2.55e-295) tmp = Float64(x * -3.0); elseif (z <= 0.6) tmp = Float64(y * 4.0); elseif (z <= 6e+105) tmp = t_1; else tmp = t_0; 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 <= -5.4e+233) tmp = t_0; elseif (z <= -1.15e-15) tmp = t_1; elseif (z <= 2.55e-295) tmp = x * -3.0; elseif (z <= 0.6) tmp = y * 4.0; elseif (z <= 6e+105) tmp = t_1; 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]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+233], t$95$0, If[LessEqual[z, -1.15e-15], t$95$1, If[LessEqual[z, 2.55e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6e+105], t$95$1, t$95$0]]]]]]]
\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 -5.4 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -5.40000000000000017e233 or 6.0000000000000001e105 < z Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 67.4%
*-commutative67.4%
Simplified67.4%
if -5.40000000000000017e233 < z < -1.14999999999999995e-15 or 0.599999999999999978 < z < 6.0000000000000001e105Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around inf 59.0%
Taylor expanded in z around inf 58.4%
if -1.14999999999999995e-15 < z < 2.54999999999999995e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 2.54999999999999995e-295 < z < 0.599999999999999978Initial 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 y around inf 57.8%
Taylor expanded in z around 0 56.3%
*-commutative56.3%
Simplified56.3%
Final simplification60.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* z (* x 6.0))))
(if (<= z -3.8e+233)
t_0
(if (<= z -1.15e-15)
t_1
(if (<= z 4.5e-295)
(* x -3.0)
(if (<= z 0.56) (* y 4.0) (if (<= z 4.6e+105) t_1 t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = z * (x * 6.0);
double tmp;
if (z <= -3.8e+233) {
tmp = t_0;
} else if (z <= -1.15e-15) {
tmp = t_1;
} else if (z <= 4.5e-295) {
tmp = x * -3.0;
} else if (z <= 0.56) {
tmp = y * 4.0;
} else if (z <= 4.6e+105) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = z * (x * 6.0d0)
if (z <= (-3.8d+233)) then
tmp = t_0
else if (z <= (-1.15d-15)) then
tmp = t_1
else if (z <= 4.5d-295) then
tmp = x * (-3.0d0)
else if (z <= 0.56d0) then
tmp = y * 4.0d0
else if (z <= 4.6d+105) then
tmp = t_1
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 t_1 = z * (x * 6.0);
double tmp;
if (z <= -3.8e+233) {
tmp = t_0;
} else if (z <= -1.15e-15) {
tmp = t_1;
} else if (z <= 4.5e-295) {
tmp = x * -3.0;
} else if (z <= 0.56) {
tmp = y * 4.0;
} else if (z <= 4.6e+105) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = z * (x * 6.0) tmp = 0 if z <= -3.8e+233: tmp = t_0 elif z <= -1.15e-15: tmp = t_1 elif z <= 4.5e-295: tmp = x * -3.0 elif z <= 0.56: tmp = y * 4.0 elif z <= 4.6e+105: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(z * Float64(x * 6.0)) tmp = 0.0 if (z <= -3.8e+233) tmp = t_0; elseif (z <= -1.15e-15) tmp = t_1; elseif (z <= 4.5e-295) tmp = Float64(x * -3.0); elseif (z <= 0.56) tmp = Float64(y * 4.0); elseif (z <= 4.6e+105) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = z * (x * 6.0); tmp = 0.0; if (z <= -3.8e+233) tmp = t_0; elseif (z <= -1.15e-15) tmp = t_1; elseif (z <= 4.5e-295) tmp = x * -3.0; elseif (z <= 0.56) tmp = y * 4.0; elseif (z <= 4.6e+105) tmp = t_1; 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]}, Block[{t$95$1 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+233], t$95$0, If[LessEqual[z, -1.15e-15], t$95$1, If[LessEqual[z, 4.5e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.6e+105], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := z \cdot \left(x \cdot 6\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.7999999999999999e233 or 4.5999999999999996e105 < z Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 67.4%
*-commutative67.4%
Simplified67.4%
if -3.7999999999999999e233 < z < -1.14999999999999995e-15 or 0.56000000000000005 < z < 4.5999999999999996e105Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around inf 59.0%
Taylor expanded in z around inf 58.4%
*-commutative58.4%
associate-*l*58.6%
Simplified58.6%
if -1.14999999999999995e-15 < z < 4.5000000000000002e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 4.5000000000000002e-295 < z < 0.56000000000000005Initial 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 y around inf 57.8%
Taylor expanded in z around 0 56.3%
*-commutative56.3%
Simplified56.3%
Final simplification60.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -6.3e+233)
t_0
(if (<= z -1.15e-15)
(* x (* z 6.0))
(if (<= z 2.8e-295)
(* x -3.0)
(if (<= z 0.62)
(* y 4.0)
(if (<= z 1.2e+106) (* z (* x 6.0)) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -6.3e+233) {
tmp = t_0;
} else if (z <= -1.15e-15) {
tmp = x * (z * 6.0);
} else if (z <= 2.8e-295) {
tmp = x * -3.0;
} else if (z <= 0.62) {
tmp = y * 4.0;
} else if (z <= 1.2e+106) {
tmp = z * (x * 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) * (y * z)
if (z <= (-6.3d+233)) then
tmp = t_0
else if (z <= (-1.15d-15)) then
tmp = x * (z * 6.0d0)
else if (z <= 2.8d-295) then
tmp = x * (-3.0d0)
else if (z <= 0.62d0) then
tmp = y * 4.0d0
else if (z <= 1.2d+106) then
tmp = z * (x * 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 * (y * z);
double tmp;
if (z <= -6.3e+233) {
tmp = t_0;
} else if (z <= -1.15e-15) {
tmp = x * (z * 6.0);
} else if (z <= 2.8e-295) {
tmp = x * -3.0;
} else if (z <= 0.62) {
tmp = y * 4.0;
} else if (z <= 1.2e+106) {
tmp = z * (x * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -6.3e+233: tmp = t_0 elif z <= -1.15e-15: tmp = x * (z * 6.0) elif z <= 2.8e-295: tmp = x * -3.0 elif z <= 0.62: tmp = y * 4.0 elif z <= 1.2e+106: tmp = z * (x * 6.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 <= -6.3e+233) tmp = t_0; elseif (z <= -1.15e-15) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= 2.8e-295) tmp = Float64(x * -3.0); elseif (z <= 0.62) tmp = Float64(y * 4.0); elseif (z <= 1.2e+106) tmp = Float64(z * Float64(x * 6.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 <= -6.3e+233) tmp = t_0; elseif (z <= -1.15e-15) tmp = x * (z * 6.0); elseif (z <= 2.8e-295) tmp = x * -3.0; elseif (z <= 0.62) tmp = y * 4.0; elseif (z <= 1.2e+106) tmp = z * (x * 6.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, -6.3e+233], t$95$0, If[LessEqual[z, -1.15e-15], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e+106], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -6.3 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+106}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -6.30000000000000034e233 or 1.2e106 < z Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 67.4%
*-commutative67.4%
Simplified67.4%
if -6.30000000000000034e233 < z < -1.14999999999999995e-15Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around inf 57.4%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
Simplified57.4%
if -1.14999999999999995e-15 < z < 2.7999999999999999e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 2.7999999999999999e-295 < z < 0.619999999999999996Initial 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 y around inf 57.8%
Taylor expanded in z around 0 56.3%
*-commutative56.3%
Simplified56.3%
if 0.619999999999999996 < z < 1.2e106Initial program 99.7%
Taylor expanded in z around 0 99.5%
Taylor expanded in x around inf 61.7%
Taylor expanded in z around inf 60.6%
*-commutative60.6%
associate-*l*60.8%
Simplified60.8%
Final simplification60.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- (* z 6.0) 3.0))) (t_1 (* y (+ 4.0 (* z -6.0)))))
(if (<= y -1e+31)
t_1
(if (<= y -2.3e-53)
t_0
(if (<= y -3.2e-105)
(* 6.0 (* y (- 0.6666666666666666 z)))
(if (<= y 15500000.0) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = x * ((z * 6.0) - 3.0);
double t_1 = y * (4.0 + (z * -6.0));
double tmp;
if (y <= -1e+31) {
tmp = t_1;
} else if (y <= -2.3e-53) {
tmp = t_0;
} else if (y <= -3.2e-105) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else if (y <= 15500000.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 = x * ((z * 6.0d0) - 3.0d0)
t_1 = y * (4.0d0 + (z * (-6.0d0)))
if (y <= (-1d+31)) then
tmp = t_1
else if (y <= (-2.3d-53)) then
tmp = t_0
else if (y <= (-3.2d-105)) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else if (y <= 15500000.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 = x * ((z * 6.0) - 3.0);
double t_1 = y * (4.0 + (z * -6.0));
double tmp;
if (y <= -1e+31) {
tmp = t_1;
} else if (y <= -2.3e-53) {
tmp = t_0;
} else if (y <= -3.2e-105) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else if (y <= 15500000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * ((z * 6.0) - 3.0) t_1 = y * (4.0 + (z * -6.0)) tmp = 0 if y <= -1e+31: tmp = t_1 elif y <= -2.3e-53: tmp = t_0 elif y <= -3.2e-105: tmp = 6.0 * (y * (0.6666666666666666 - z)) elif y <= 15500000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(Float64(z * 6.0) - 3.0)) t_1 = Float64(y * Float64(4.0 + Float64(z * -6.0))) tmp = 0.0 if (y <= -1e+31) tmp = t_1; elseif (y <= -2.3e-53) tmp = t_0; elseif (y <= -3.2e-105) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); elseif (y <= 15500000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * ((z * 6.0) - 3.0); t_1 = y * (4.0 + (z * -6.0)); tmp = 0.0; if (y <= -1e+31) tmp = t_1; elseif (y <= -2.3e-53) tmp = t_0; elseif (y <= -3.2e-105) tmp = 6.0 * (y * (0.6666666666666666 - z)); elseif (y <= 15500000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+31], t$95$1, If[LessEqual[y, -2.3e-53], t$95$0, If[LessEqual[y, -3.2e-105], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 15500000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6 - 3\right)\\
t_1 := y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-105}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{elif}\;y \leq 15500000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -9.9999999999999996e30 or 1.55e7 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 80.5%
if -9.9999999999999996e30 < y < -2.3000000000000001e-53 or -3.19999999999999981e-105 < y < 1.55e7Initial program 99.4%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 82.5%
if -2.3000000000000001e-53 < y < -3.19999999999999981e-105Initial program 99.3%
Taylor expanded in y around inf 67.1%
Taylor expanded in x around 0 67.2%
Final simplification80.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -1.15e-15)
t_0
(if (<= z 3.4e-295) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 3.4e-295) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-1.15d-15)) then
tmp = t_0
else if (z <= 3.4d-295) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 3.4e-295) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -1.15e-15: tmp = t_0 elif z <= 3.4e-295: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.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 <= -1.15e-15) tmp = t_0; elseif (z <= 3.4e-295) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -1.15e-15) tmp = t_0; elseif (z <= 3.4e-295) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-15], t$95$0, If[LessEqual[z, 3.4e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.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 -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.14999999999999995e-15 or 0.650000000000000022 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.5%
if -1.14999999999999995e-15 < z < 3.40000000000000007e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 3.40000000000000007e-295 < z < 0.650000000000000022Initial 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 y around inf 57.8%
Taylor expanded in z around 0 56.3%
*-commutative56.3%
Simplified56.3%
Final simplification77.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -1.15e-15)
t_0
(if (<= z 1.75e-295)
(* x -3.0)
(if (<= z 60000000.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 <= -1.15e-15) {
tmp = t_0;
} else if (z <= 1.75e-295) {
tmp = x * -3.0;
} else if (z <= 60000000.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 <= (-1.15d-15)) then
tmp = t_0
else if (z <= 1.75d-295) then
tmp = x * (-3.0d0)
else if (z <= 60000000.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 <= -1.15e-15) {
tmp = t_0;
} else if (z <= 1.75e-295) {
tmp = x * -3.0;
} else if (z <= 60000000.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 <= -1.15e-15: tmp = t_0 elif z <= 1.75e-295: tmp = x * -3.0 elif z <= 60000000.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 <= -1.15e-15) tmp = t_0; elseif (z <= 1.75e-295) tmp = Float64(x * -3.0); elseif (z <= 60000000.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 <= -1.15e-15) tmp = t_0; elseif (z <= 1.75e-295) tmp = x * -3.0; elseif (z <= 60000000.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, -1.15e-15], t$95$0, If[LessEqual[z, 1.75e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 60000000.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 -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 60000000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.14999999999999995e-15 or 6e7 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.0%
if -1.14999999999999995e-15 < z < 1.74999999999999994e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 1.74999999999999994e-295 < z < 6e7Initial program 99.3%
Taylor expanded in y around inf 57.4%
Taylor expanded in x around 0 58.2%
Final simplification77.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -1.15e-15)
t_0
(if (<= z 3e-295)
(* x -3.0)
(if (<= z 85000000.0) (* 6.0 (* y (- 0.6666666666666666 z))) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 3e-295) {
tmp = x * -3.0;
} else if (z <= 85000000.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 = z * ((y - x) * (-6.0d0))
if (z <= (-1.15d-15)) then
tmp = t_0
else if (z <= 3d-295) then
tmp = x * (-3.0d0)
else if (z <= 85000000.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 = z * ((y - x) * -6.0);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 3e-295) {
tmp = x * -3.0;
} else if (z <= 85000000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -1.15e-15: tmp = t_0 elif z <= 3e-295: tmp = x * -3.0 elif z <= 85000000.0: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -1.15e-15) tmp = t_0; elseif (z <= 3e-295) tmp = Float64(x * -3.0); elseif (z <= 85000000.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 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -1.15e-15) tmp = t_0; elseif (z <= 3e-295) tmp = x * -3.0; elseif (z <= 85000000.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[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-15], t$95$0, If[LessEqual[z, 3e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 85000000.0], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 85000000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.14999999999999995e-15 or 8.5e7 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.0%
*-commutative98.0%
associate-*l*98.1%
Simplified98.1%
if -1.14999999999999995e-15 < z < 2.99999999999999996e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 2.99999999999999996e-295 < z < 8.5e7Initial program 99.3%
Taylor expanded in y around inf 57.4%
Taylor expanded in x around 0 58.2%
Final simplification77.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -1.15e-15)
t_0
(if (<= z 2.2e-295)
(* x -3.0)
(if (<= z 19000000.0) (* y (+ 4.0 (* z -6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 2.2e-295) {
tmp = x * -3.0;
} else if (z <= 19000000.0) {
tmp = y * (4.0 + (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 = z * ((y - x) * (-6.0d0))
if (z <= (-1.15d-15)) then
tmp = t_0
else if (z <= 2.2d-295) then
tmp = x * (-3.0d0)
else if (z <= 19000000.0d0) then
tmp = y * (4.0d0 + (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 = z * ((y - x) * -6.0);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 2.2e-295) {
tmp = x * -3.0;
} else if (z <= 19000000.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -1.15e-15: tmp = t_0 elif z <= 2.2e-295: tmp = x * -3.0 elif z <= 19000000.0: tmp = y * (4.0 + (z * -6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -1.15e-15) tmp = t_0; elseif (z <= 2.2e-295) tmp = Float64(x * -3.0); elseif (z <= 19000000.0) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -1.15e-15) tmp = t_0; elseif (z <= 2.2e-295) tmp = x * -3.0; elseif (z <= 19000000.0) tmp = y * (4.0 + (z * -6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-15], t$95$0, If[LessEqual[z, 2.2e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 19000000.0], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 19000000:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.14999999999999995e-15 or 1.9e7 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.0%
*-commutative98.0%
associate-*l*98.1%
Simplified98.1%
if -1.14999999999999995e-15 < z < 2.2000000000000002e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 2.2000000000000002e-295 < z < 1.9e7Initial 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 y around inf 58.5%
Final simplification77.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.15e-15)
t_0
(if (<= z 3e-295) (* x -3.0) (if (<= z 0.66) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 3e-295) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1.15d-15)) then
tmp = t_0
else if (z <= 3d-295) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.15e-15) {
tmp = t_0;
} else if (z <= 3e-295) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.15e-15: tmp = t_0 elif z <= 3e-295: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.15e-15) tmp = t_0; elseif (z <= 3e-295) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.15e-15) tmp = t_0; elseif (z <= 3e-295) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-15], t$95$0, If[LessEqual[z, 3e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.14999999999999995e-15 or 0.660000000000000031 < z Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.5%
Taylor expanded in y around inf 55.0%
*-commutative55.0%
Simplified55.0%
if -1.14999999999999995e-15 < z < 2.99999999999999996e-295Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 59.3%
Taylor expanded in z around 0 59.3%
*-commutative59.3%
Simplified59.3%
if 2.99999999999999996e-295 < z < 0.660000000000000031Initial 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 y around inf 57.8%
Taylor expanded in z around 0 56.3%
*-commutative56.3%
Simplified56.3%
Final simplification56.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.52))) (* z (* (- y x) -6.0)) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.52)) {
tmp = z * ((y - x) * -6.0);
} 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.56d0)) .or. (.not. (z <= 0.52d0))) then
tmp = z * ((y - x) * (-6.0d0))
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.56) || !(z <= 0.52)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.52): tmp = z * ((y - x) * -6.0) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.52)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); 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.56) || ~((z <= 0.52))) tmp = z * ((y - x) * -6.0); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.52]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $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.56 \lor \neg \left(z \leq 0.52\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.52000000000000002 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
*-commutative98.9%
associate-*l*99.0%
Simplified99.0%
if -0.56000000000000005 < z < 0.52000000000000002Initial program 99.3%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.3%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) * (6.0d0 * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + ((y - x) * (6.0 * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.5%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= y -7.6e+108) (* y 4.0) (if (<= y 23000000.0) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+108) {
tmp = y * 4.0;
} else if (y <= 23000000.0) {
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 <= (-7.6d+108)) then
tmp = y * 4.0d0
else if (y <= 23000000.0d0) 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 <= -7.6e+108) {
tmp = y * 4.0;
} else if (y <= 23000000.0) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.6e+108: tmp = y * 4.0 elif y <= 23000000.0: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.6e+108) tmp = Float64(y * 4.0); elseif (y <= 23000000.0) 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 <= -7.6e+108) tmp = y * 4.0; elseif (y <= 23000000.0) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.6e+108], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 23000000.0], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+108}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 23000000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if y < -7.60000000000000015e108 or 2.3e7 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 82.9%
Taylor expanded in z around 0 40.9%
*-commutative40.9%
Simplified40.9%
if -7.60000000000000015e108 < y < 2.3e7Initial program 99.4%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around inf 73.8%
Taylor expanded in z around 0 41.5%
*-commutative41.5%
Simplified41.5%
Final simplification41.2%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 52.3%
Taylor expanded in z around 0 26.8%
*-commutative26.8%
Simplified26.8%
Final simplification26.8%
herbie shell --seed 2023242
(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))))