
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.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) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* 6.0 (* z (- y x)))))
double code(double x, double y, double z) {
return x + (6.0 * (z * (y - 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 + (6.0d0 * (z * (y - x)))
end function
public static double code(double x, double y, double z) {
return x + (6.0 * (z * (y - x)));
}
def code(x, y, z): return x + (6.0 * (z * (y - x)))
function code(x, y, z) return Float64(x + Float64(6.0 * Float64(z * Float64(y - x)))) end
function tmp = code(x, y, z) tmp = x + (6.0 * (z * (y - x))); end
code[x_, y_, z_] := N[(x + N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 6 \cdot \left(z \cdot \left(y - x\right)\right)
\end{array}
Initial program 99.5%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z y))))
(if (<= z -2.7e-12)
t_0
(if (<= z 5.1e-169)
x
(if (<= z 5.7e-133)
t_0
(if (<= z 1860.0)
x
(if (or (<= z 2.95e+109) (not (<= z 5.6e+228)))
(* -6.0 (* x z))
t_0)))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -2.7e-12) {
tmp = t_0;
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.7e-133) {
tmp = t_0;
} else if (z <= 1860.0) {
tmp = x;
} else if ((z <= 2.95e+109) || !(z <= 5.6e+228)) {
tmp = -6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * y)
if (z <= (-2.7d-12)) then
tmp = t_0
else if (z <= 5.1d-169) then
tmp = x
else if (z <= 5.7d-133) then
tmp = t_0
else if (z <= 1860.0d0) then
tmp = x
else if ((z <= 2.95d+109) .or. (.not. (z <= 5.6d+228))) then
tmp = (-6.0d0) * (x * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -2.7e-12) {
tmp = t_0;
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.7e-133) {
tmp = t_0;
} else if (z <= 1860.0) {
tmp = x;
} else if ((z <= 2.95e+109) || !(z <= 5.6e+228)) {
tmp = -6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * y) tmp = 0 if z <= -2.7e-12: tmp = t_0 elif z <= 5.1e-169: tmp = x elif z <= 5.7e-133: tmp = t_0 elif z <= 1860.0: tmp = x elif (z <= 2.95e+109) or not (z <= 5.6e+228): tmp = -6.0 * (x * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -2.7e-12) tmp = t_0; elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.7e-133) tmp = t_0; elseif (z <= 1860.0) tmp = x; elseif ((z <= 2.95e+109) || !(z <= 5.6e+228)) tmp = Float64(-6.0 * Float64(x * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * y); tmp = 0.0; if (z <= -2.7e-12) tmp = t_0; elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.7e-133) tmp = t_0; elseif (z <= 1860.0) tmp = x; elseif ((z <= 2.95e+109) || ~((z <= 5.6e+228))) tmp = -6.0 * (x * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e-12], t$95$0, If[LessEqual[z, 5.1e-169], x, If[LessEqual[z, 5.7e-133], t$95$0, If[LessEqual[z, 1860.0], x, If[Or[LessEqual[z, 2.95e+109], N[Not[LessEqual[z, 5.6e+228]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1860:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{+109} \lor \neg \left(z \leq 5.6 \cdot 10^{+228}\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.6999999999999998e-12 or 5.09999999999999997e-169 < z < 5.6999999999999997e-133 or 2.9499999999999999e109 < z < 5.5999999999999998e228Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 96.6%
Taylor expanded in y around inf 67.0%
*-commutative67.0%
Simplified67.0%
if -2.6999999999999998e-12 < z < 5.09999999999999997e-169 or 5.6999999999999997e-133 < z < 1860Initial program 99.1%
Taylor expanded in z around 0 72.3%
if 1860 < z < 2.9499999999999999e109 or 5.5999999999999998e228 < z Initial program 99.9%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.1%
Taylor expanded in y around 0 70.9%
Final simplification69.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z y))))
(if (<= z -1.45e-13)
(* y (* 6.0 z))
(if (<= z 5.1e-169)
x
(if (<= z 5.5e-131)
t_0
(if (<= z 1860.0)
x
(if (or (<= z 4.2e+107) (not (<= z 2.45e+229)))
(* -6.0 (* x z))
t_0)))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -1.45e-13) {
tmp = y * (6.0 * z);
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.5e-131) {
tmp = t_0;
} else if (z <= 1860.0) {
tmp = x;
} else if ((z <= 4.2e+107) || !(z <= 2.45e+229)) {
tmp = -6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * y)
if (z <= (-1.45d-13)) then
tmp = y * (6.0d0 * z)
else if (z <= 5.1d-169) then
tmp = x
else if (z <= 5.5d-131) then
tmp = t_0
else if (z <= 1860.0d0) then
tmp = x
else if ((z <= 4.2d+107) .or. (.not. (z <= 2.45d+229))) then
tmp = (-6.0d0) * (x * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -1.45e-13) {
tmp = y * (6.0 * z);
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.5e-131) {
tmp = t_0;
} else if (z <= 1860.0) {
tmp = x;
} else if ((z <= 4.2e+107) || !(z <= 2.45e+229)) {
tmp = -6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * y) tmp = 0 if z <= -1.45e-13: tmp = y * (6.0 * z) elif z <= 5.1e-169: tmp = x elif z <= 5.5e-131: tmp = t_0 elif z <= 1860.0: tmp = x elif (z <= 4.2e+107) or not (z <= 2.45e+229): tmp = -6.0 * (x * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -1.45e-13) tmp = Float64(y * Float64(6.0 * z)); elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.5e-131) tmp = t_0; elseif (z <= 1860.0) tmp = x; elseif ((z <= 4.2e+107) || !(z <= 2.45e+229)) tmp = Float64(-6.0 * Float64(x * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * y); tmp = 0.0; if (z <= -1.45e-13) tmp = y * (6.0 * z); elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.5e-131) tmp = t_0; elseif (z <= 1860.0) tmp = x; elseif ((z <= 4.2e+107) || ~((z <= 2.45e+229))) tmp = -6.0 * (x * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e-13], N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-169], x, If[LessEqual[z, 5.5e-131], t$95$0, If[LessEqual[z, 1860.0], x, If[Or[LessEqual[z, 4.2e+107], N[Not[LessEqual[z, 2.45e+229]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-13}:\\
\;\;\;\;y \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-131}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1860:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+107} \lor \neg \left(z \leq 2.45 \cdot 10^{+229}\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.4499999999999999e-13Initial program 99.7%
Taylor expanded in y around inf 67.8%
*-commutative67.8%
associate-*r*67.8%
Simplified67.8%
Taylor expanded in x around inf 49.7%
+-commutative49.7%
associate-/l*43.9%
Simplified43.9%
Taylor expanded in x around 0 66.9%
*-commutative66.9%
associate-*l*66.9%
*-commutative66.9%
Simplified66.9%
if -1.4499999999999999e-13 < z < 5.09999999999999997e-169 or 5.4999999999999997e-131 < z < 1860Initial program 99.1%
Taylor expanded in z around 0 72.3%
if 5.09999999999999997e-169 < z < 5.4999999999999997e-131 or 4.1999999999999999e107 < z < 2.45000000000000017e229Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 92.1%
Taylor expanded in y around inf 67.2%
*-commutative67.2%
Simplified67.2%
if 1860 < z < 4.1999999999999999e107 or 2.45000000000000017e229 < z Initial program 99.9%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.1%
Taylor expanded in y around 0 70.9%
Final simplification69.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z y))))
(if (<= z -3.8e-15)
(* y (* 6.0 z))
(if (<= z 5.1e-169)
x
(if (<= z 5.5e-135)
t_0
(if (<= z 1860.0)
x
(if (<= z 1.5e+108)
(* z (* x -6.0))
(if (<= z 1.75e+229) t_0 (* -6.0 (* x z))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -3.8e-15) {
tmp = y * (6.0 * z);
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.5e-135) {
tmp = t_0;
} else if (z <= 1860.0) {
tmp = x;
} else if (z <= 1.5e+108) {
tmp = z * (x * -6.0);
} else if (z <= 1.75e+229) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (z * y)
if (z <= (-3.8d-15)) then
tmp = y * (6.0d0 * z)
else if (z <= 5.1d-169) then
tmp = x
else if (z <= 5.5d-135) then
tmp = t_0
else if (z <= 1860.0d0) then
tmp = x
else if (z <= 1.5d+108) then
tmp = z * (x * (-6.0d0))
else if (z <= 1.75d+229) then
tmp = t_0
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (z * y);
double tmp;
if (z <= -3.8e-15) {
tmp = y * (6.0 * z);
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.5e-135) {
tmp = t_0;
} else if (z <= 1860.0) {
tmp = x;
} else if (z <= 1.5e+108) {
tmp = z * (x * -6.0);
} else if (z <= 1.75e+229) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * y) tmp = 0 if z <= -3.8e-15: tmp = y * (6.0 * z) elif z <= 5.1e-169: tmp = x elif z <= 5.5e-135: tmp = t_0 elif z <= 1860.0: tmp = x elif z <= 1.5e+108: tmp = z * (x * -6.0) elif z <= 1.75e+229: tmp = t_0 else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * y)) tmp = 0.0 if (z <= -3.8e-15) tmp = Float64(y * Float64(6.0 * z)); elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.5e-135) tmp = t_0; elseif (z <= 1860.0) tmp = x; elseif (z <= 1.5e+108) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= 1.75e+229) tmp = t_0; else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * y); tmp = 0.0; if (z <= -3.8e-15) tmp = y * (6.0 * z); elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.5e-135) tmp = t_0; elseif (z <= 1860.0) tmp = x; elseif (z <= 1.5e+108) tmp = z * (x * -6.0); elseif (z <= 1.75e+229) tmp = t_0; else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-15], N[(y * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-169], x, If[LessEqual[z, 5.5e-135], t$95$0, If[LessEqual[z, 1860.0], x, If[LessEqual[z, 1.5e+108], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+229], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-15}:\\
\;\;\;\;y \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1860:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+108}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+229}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -3.8000000000000002e-15Initial program 99.7%
Taylor expanded in y around inf 67.8%
*-commutative67.8%
associate-*r*67.8%
Simplified67.8%
Taylor expanded in x around inf 49.7%
+-commutative49.7%
associate-/l*43.9%
Simplified43.9%
Taylor expanded in x around 0 66.9%
*-commutative66.9%
associate-*l*66.9%
*-commutative66.9%
Simplified66.9%
if -3.8000000000000002e-15 < z < 5.09999999999999997e-169 or 5.4999999999999999e-135 < z < 1860Initial program 99.1%
Taylor expanded in z around 0 72.3%
if 5.09999999999999997e-169 < z < 5.4999999999999999e-135 or 1.49999999999999992e108 < z < 1.7500000000000001e229Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 92.1%
Taylor expanded in y around inf 67.2%
*-commutative67.2%
Simplified67.2%
if 1860 < z < 1.49999999999999992e108Initial program 99.9%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 96.6%
Taylor expanded in y around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
*-commutative67.1%
*-commutative67.1%
Simplified67.1%
if 1.7500000000000001e229 < z Initial program 100.0%
Taylor expanded in z around 0 99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around 0 75.2%
Final simplification69.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* 6.0 y))))
(if (<= z -1.12e-13)
t_0
(if (<= z 5.1e-169)
x
(if (<= z 5.5e-135)
(* 6.0 (* z y))
(if (<= z 1860.0)
x
(if (<= z 3.1e+107)
(* z (* x -6.0))
(if (<= z 6.6e+228) t_0 (* -6.0 (* x z))))))))))
double code(double x, double y, double z) {
double t_0 = z * (6.0 * y);
double tmp;
if (z <= -1.12e-13) {
tmp = t_0;
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 1860.0) {
tmp = x;
} else if (z <= 3.1e+107) {
tmp = z * (x * -6.0);
} else if (z <= 6.6e+228) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * (6.0d0 * y)
if (z <= (-1.12d-13)) then
tmp = t_0
else if (z <= 5.1d-169) then
tmp = x
else if (z <= 5.5d-135) then
tmp = 6.0d0 * (z * y)
else if (z <= 1860.0d0) then
tmp = x
else if (z <= 3.1d+107) then
tmp = z * (x * (-6.0d0))
else if (z <= 6.6d+228) then
tmp = t_0
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (6.0 * y);
double tmp;
if (z <= -1.12e-13) {
tmp = t_0;
} else if (z <= 5.1e-169) {
tmp = x;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 1860.0) {
tmp = x;
} else if (z <= 3.1e+107) {
tmp = z * (x * -6.0);
} else if (z <= 6.6e+228) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = z * (6.0 * y) tmp = 0 if z <= -1.12e-13: tmp = t_0 elif z <= 5.1e-169: tmp = x elif z <= 5.5e-135: tmp = 6.0 * (z * y) elif z <= 1860.0: tmp = x elif z <= 3.1e+107: tmp = z * (x * -6.0) elif z <= 6.6e+228: tmp = t_0 else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(6.0 * y)) tmp = 0.0 if (z <= -1.12e-13) tmp = t_0; elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.5e-135) tmp = Float64(6.0 * Float64(z * y)); elseif (z <= 1860.0) tmp = x; elseif (z <= 3.1e+107) tmp = Float64(z * Float64(x * -6.0)); elseif (z <= 6.6e+228) tmp = t_0; else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (6.0 * y); tmp = 0.0; if (z <= -1.12e-13) tmp = t_0; elseif (z <= 5.1e-169) tmp = x; elseif (z <= 5.5e-135) tmp = 6.0 * (z * y); elseif (z <= 1860.0) tmp = x; elseif (z <= 3.1e+107) tmp = z * (x * -6.0); elseif (z <= 6.6e+228) tmp = t_0; else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(6.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.12e-13], t$95$0, If[LessEqual[z, 5.1e-169], x, If[LessEqual[z, 5.5e-135], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1860.0], x, If[LessEqual[z, 3.1e+107], N[(z * N[(x * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+228], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(6 \cdot y\right)\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-135}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 1860:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+107}:\\
\;\;\;\;z \cdot \left(x \cdot -6\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+228}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -1.12e-13 or 3.10000000000000026e107 < z < 6.60000000000000011e228Initial program 99.8%
Taylor expanded in y around inf 66.9%
*-commutative66.9%
associate-*r*66.9%
Simplified66.9%
Taylor expanded in x around inf 49.2%
+-commutative49.2%
associate-/l*44.0%
Simplified44.0%
Taylor expanded in x around 0 66.4%
associate-*r*66.4%
*-commutative66.4%
Simplified66.4%
if -1.12e-13 < z < 5.09999999999999997e-169 or 5.4999999999999999e-135 < z < 1860Initial program 99.1%
Taylor expanded in z around 0 72.3%
if 5.09999999999999997e-169 < z < 5.4999999999999999e-135Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 72.5%
Taylor expanded in y around inf 72.6%
*-commutative72.6%
Simplified72.6%
if 1860 < z < 3.10000000000000026e107Initial program 99.9%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 96.6%
Taylor expanded in y around 0 67.1%
associate-*r*67.1%
*-commutative67.1%
*-commutative67.1%
*-commutative67.1%
Simplified67.1%
if 6.60000000000000011e228 < z Initial program 100.0%
Taylor expanded in z around 0 99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around 0 75.2%
Final simplification69.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* z (- y x)))))
(if (<= z -3e-13)
t_0
(if (<= z 4.7e-169)
x
(if (<= z 5.5e-135) (* 6.0 (* z y)) (if (<= z 8.2e-19) x t_0))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (z * (y - x));
double tmp;
if (z <= -3e-13) {
tmp = t_0;
} else if (z <= 4.7e-169) {
tmp = x;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 8.2e-19) {
tmp = x;
} 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 * (z * (y - x))
if (z <= (-3d-13)) then
tmp = t_0
else if (z <= 4.7d-169) then
tmp = x
else if (z <= 5.5d-135) then
tmp = 6.0d0 * (z * y)
else if (z <= 8.2d-19) then
tmp = x
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 * (z * (y - x));
double tmp;
if (z <= -3e-13) {
tmp = t_0;
} else if (z <= 4.7e-169) {
tmp = x;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 8.2e-19) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (z * (y - x)) tmp = 0 if z <= -3e-13: tmp = t_0 elif z <= 4.7e-169: tmp = x elif z <= 5.5e-135: tmp = 6.0 * (z * y) elif z <= 8.2e-19: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -3e-13) tmp = t_0; elseif (z <= 4.7e-169) tmp = x; elseif (z <= 5.5e-135) tmp = Float64(6.0 * Float64(z * y)); elseif (z <= 8.2e-19) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -3e-13) tmp = t_0; elseif (z <= 4.7e-169) tmp = x; elseif (z <= 5.5e-135) tmp = 6.0 * (z * y); elseif (z <= 8.2e-19) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e-13], t$95$0, If[LessEqual[z, 4.7e-169], x, If[LessEqual[z, 5.5e-135], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-19], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-169}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-135}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-19}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.99999999999999984e-13 or 8.1999999999999997e-19 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.7%
if -2.99999999999999984e-13 < z < 4.6999999999999999e-169 or 5.4999999999999999e-135 < z < 8.1999999999999997e-19Initial program 99.1%
Taylor expanded in z around 0 75.0%
if 4.6999999999999999e-169 < z < 5.4999999999999999e-135Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 72.5%
Taylor expanded in y around inf 72.6%
*-commutative72.6%
Simplified72.6%
Final simplification87.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (* z -6.0) 1.0))) (t_1 (* 6.0 (* z (- y x)))))
(if (<= z -9.6e-15)
t_1
(if (<= z 5.1e-169)
t_0
(if (<= z 5.5e-135) (* 6.0 (* z y)) (if (<= z 0.000185) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = x * ((z * -6.0) + 1.0);
double t_1 = 6.0 * (z * (y - x));
double tmp;
if (z <= -9.6e-15) {
tmp = t_1;
} else if (z <= 5.1e-169) {
tmp = t_0;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 0.000185) {
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)) + 1.0d0)
t_1 = 6.0d0 * (z * (y - x))
if (z <= (-9.6d-15)) then
tmp = t_1
else if (z <= 5.1d-169) then
tmp = t_0
else if (z <= 5.5d-135) then
tmp = 6.0d0 * (z * y)
else if (z <= 0.000185d0) 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) + 1.0);
double t_1 = 6.0 * (z * (y - x));
double tmp;
if (z <= -9.6e-15) {
tmp = t_1;
} else if (z <= 5.1e-169) {
tmp = t_0;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 0.000185) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * ((z * -6.0) + 1.0) t_1 = 6.0 * (z * (y - x)) tmp = 0 if z <= -9.6e-15: tmp = t_1 elif z <= 5.1e-169: tmp = t_0 elif z <= 5.5e-135: tmp = 6.0 * (z * y) elif z <= 0.000185: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(Float64(z * -6.0) + 1.0)) t_1 = Float64(6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -9.6e-15) tmp = t_1; elseif (z <= 5.1e-169) tmp = t_0; elseif (z <= 5.5e-135) tmp = Float64(6.0 * Float64(z * y)); elseif (z <= 0.000185) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * ((z * -6.0) + 1.0); t_1 = 6.0 * (z * (y - x)); tmp = 0.0; if (z <= -9.6e-15) tmp = t_1; elseif (z <= 5.1e-169) tmp = t_0; elseif (z <= 5.5e-135) tmp = 6.0 * (z * y); elseif (z <= 0.000185) 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] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e-15], t$95$1, If[LessEqual[z, 5.1e-169], t$95$0, If[LessEqual[z, 5.5e-135], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.000185], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot -6 + 1\right)\\
t_1 := 6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-135}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 0.000185:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.5999999999999998e-15 or 1.85e-4 < z Initial program 99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.0%
if -9.5999999999999998e-15 < z < 5.09999999999999997e-169 or 5.4999999999999999e-135 < z < 1.85e-4Initial program 99.1%
Taylor expanded in x around inf 74.7%
+-commutative74.7%
Simplified74.7%
if 5.09999999999999997e-169 < z < 5.4999999999999999e-135Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 72.5%
Taylor expanded in y around inf 72.6%
*-commutative72.6%
Simplified72.6%
Final simplification88.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (* z -6.0) 1.0))))
(if (<= z -1.8e-14)
(* (- y x) (* 6.0 z))
(if (<= z 5.1e-169)
t_0
(if (<= z 5.5e-135)
(* 6.0 (* z y))
(if (<= z 0.0016) t_0 (* 6.0 (* z (- y x)))))))))
double code(double x, double y, double z) {
double t_0 = x * ((z * -6.0) + 1.0);
double tmp;
if (z <= -1.8e-14) {
tmp = (y - x) * (6.0 * z);
} else if (z <= 5.1e-169) {
tmp = t_0;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 0.0016) {
tmp = t_0;
} else {
tmp = 6.0 * (z * (y - x));
}
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 = x * ((z * (-6.0d0)) + 1.0d0)
if (z <= (-1.8d-14)) then
tmp = (y - x) * (6.0d0 * z)
else if (z <= 5.1d-169) then
tmp = t_0
else if (z <= 5.5d-135) then
tmp = 6.0d0 * (z * y)
else if (z <= 0.0016d0) then
tmp = t_0
else
tmp = 6.0d0 * (z * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * ((z * -6.0) + 1.0);
double tmp;
if (z <= -1.8e-14) {
tmp = (y - x) * (6.0 * z);
} else if (z <= 5.1e-169) {
tmp = t_0;
} else if (z <= 5.5e-135) {
tmp = 6.0 * (z * y);
} else if (z <= 0.0016) {
tmp = t_0;
} else {
tmp = 6.0 * (z * (y - x));
}
return tmp;
}
def code(x, y, z): t_0 = x * ((z * -6.0) + 1.0) tmp = 0 if z <= -1.8e-14: tmp = (y - x) * (6.0 * z) elif z <= 5.1e-169: tmp = t_0 elif z <= 5.5e-135: tmp = 6.0 * (z * y) elif z <= 0.0016: tmp = t_0 else: tmp = 6.0 * (z * (y - x)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(Float64(z * -6.0) + 1.0)) tmp = 0.0 if (z <= -1.8e-14) tmp = Float64(Float64(y - x) * Float64(6.0 * z)); elseif (z <= 5.1e-169) tmp = t_0; elseif (z <= 5.5e-135) tmp = Float64(6.0 * Float64(z * y)); elseif (z <= 0.0016) tmp = t_0; else tmp = Float64(6.0 * Float64(z * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * ((z * -6.0) + 1.0); tmp = 0.0; if (z <= -1.8e-14) tmp = (y - x) * (6.0 * z); elseif (z <= 5.1e-169) tmp = t_0; elseif (z <= 5.5e-135) tmp = 6.0 * (z * y); elseif (z <= 0.0016) tmp = t_0; else tmp = 6.0 * (z * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * -6.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e-14], N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-169], t$95$0, If[LessEqual[z, 5.5e-135], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0016], t$95$0, N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot -6 + 1\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-135}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 0.0016:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if z < -1.7999999999999999e-14Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.2%
Taylor expanded in y around 0 96.3%
*-commutative96.3%
associate-*r*96.3%
metadata-eval96.3%
distribute-lft-neg-in96.3%
distribute-lft-neg-in96.3%
distribute-rgt-neg-out96.3%
*-commutative96.3%
associate-*r*96.3%
distribute-lft-out99.2%
*-commutative99.2%
+-commutative99.2%
sub-neg99.2%
Simplified99.2%
if -1.7999999999999999e-14 < z < 5.09999999999999997e-169 or 5.4999999999999999e-135 < z < 0.00160000000000000008Initial program 99.1%
Taylor expanded in x around inf 74.7%
+-commutative74.7%
Simplified74.7%
if 5.09999999999999997e-169 < z < 5.4999999999999999e-135Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 72.5%
Taylor expanded in y around inf 72.6%
*-commutative72.6%
Simplified72.6%
if 0.00160000000000000008 < z Initial program 99.9%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.8%
Final simplification88.0%
(FPCore (x y z)
:precision binary64
(if (<= z -2.3e-15)
(* (- y x) (* 6.0 z))
(if (<= z 5.2e-172)
(+ x (* -6.0 (* x z)))
(if (<= z 5.4e-129)
(* 6.0 (* z y))
(if (<= z 0.00023) (* x (+ (* z -6.0) 1.0)) (* 6.0 (* z (- y x))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.3e-15) {
tmp = (y - x) * (6.0 * z);
} else if (z <= 5.2e-172) {
tmp = x + (-6.0 * (x * z));
} else if (z <= 5.4e-129) {
tmp = 6.0 * (z * y);
} else if (z <= 0.00023) {
tmp = x * ((z * -6.0) + 1.0);
} else {
tmp = 6.0 * (z * (y - x));
}
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.3d-15)) then
tmp = (y - x) * (6.0d0 * z)
else if (z <= 5.2d-172) then
tmp = x + ((-6.0d0) * (x * z))
else if (z <= 5.4d-129) then
tmp = 6.0d0 * (z * y)
else if (z <= 0.00023d0) then
tmp = x * ((z * (-6.0d0)) + 1.0d0)
else
tmp = 6.0d0 * (z * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.3e-15) {
tmp = (y - x) * (6.0 * z);
} else if (z <= 5.2e-172) {
tmp = x + (-6.0 * (x * z));
} else if (z <= 5.4e-129) {
tmp = 6.0 * (z * y);
} else if (z <= 0.00023) {
tmp = x * ((z * -6.0) + 1.0);
} else {
tmp = 6.0 * (z * (y - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.3e-15: tmp = (y - x) * (6.0 * z) elif z <= 5.2e-172: tmp = x + (-6.0 * (x * z)) elif z <= 5.4e-129: tmp = 6.0 * (z * y) elif z <= 0.00023: tmp = x * ((z * -6.0) + 1.0) else: tmp = 6.0 * (z * (y - x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.3e-15) tmp = Float64(Float64(y - x) * Float64(6.0 * z)); elseif (z <= 5.2e-172) tmp = Float64(x + Float64(-6.0 * Float64(x * z))); elseif (z <= 5.4e-129) tmp = Float64(6.0 * Float64(z * y)); elseif (z <= 0.00023) tmp = Float64(x * Float64(Float64(z * -6.0) + 1.0)); else tmp = Float64(6.0 * Float64(z * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.3e-15) tmp = (y - x) * (6.0 * z); elseif (z <= 5.2e-172) tmp = x + (-6.0 * (x * z)); elseif (z <= 5.4e-129) tmp = 6.0 * (z * y); elseif (z <= 0.00023) tmp = x * ((z * -6.0) + 1.0); else tmp = 6.0 * (z * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.3e-15], N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-172], N[(x + N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-129], N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00023], N[(x * N[(N[(z * -6.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-15}:\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-172}:\\
\;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-129}:\\
\;\;\;\;6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 0.00023:\\
\;\;\;\;x \cdot \left(z \cdot -6 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if z < -2.2999999999999999e-15Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.2%
Taylor expanded in y around 0 96.3%
*-commutative96.3%
associate-*r*96.3%
metadata-eval96.3%
distribute-lft-neg-in96.3%
distribute-lft-neg-in96.3%
distribute-rgt-neg-out96.3%
*-commutative96.3%
associate-*r*96.3%
distribute-lft-out99.2%
*-commutative99.2%
+-commutative99.2%
sub-neg99.2%
Simplified99.2%
if -2.2999999999999999e-15 < z < 5.1999999999999996e-172Initial program 98.8%
Taylor expanded in y around 0 74.5%
if 5.1999999999999996e-172 < z < 5.39999999999999998e-129Initial program 99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 72.5%
Taylor expanded in y around inf 72.6%
*-commutative72.6%
Simplified72.6%
if 5.39999999999999998e-129 < z < 2.3000000000000001e-4Initial program 99.8%
Taylor expanded in x around inf 75.4%
+-commutative75.4%
Simplified75.4%
if 2.3000000000000001e-4 < z Initial program 99.9%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.8%
Final simplification88.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.17) (not (<= z 1.5))) (* 6.0 (* z (- y x))) (+ x (* z (* 6.0 y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.17) || !(z <= 1.5)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x + (z * (6.0 * y));
}
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.17d0)) .or. (.not. (z <= 1.5d0))) then
tmp = 6.0d0 * (z * (y - x))
else
tmp = x + (z * (6.0d0 * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.17) || !(z <= 1.5)) {
tmp = 6.0 * (z * (y - x));
} else {
tmp = x + (z * (6.0 * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.17) or not (z <= 1.5): tmp = 6.0 * (z * (y - x)) else: tmp = x + (z * (6.0 * y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.17) || !(z <= 1.5)) tmp = Float64(6.0 * Float64(z * Float64(y - x))); else tmp = Float64(x + Float64(z * Float64(6.0 * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.17) || ~((z <= 1.5))) tmp = 6.0 * (z * (y - x)); else tmp = x + (z * (6.0 * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.17], N[Not[LessEqual[z, 1.5]], $MachinePrecision]], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.17 \lor \neg \left(z \leq 1.5\right):\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot y\right)\\
\end{array}
\end{array}
if z < -0.170000000000000012 or 1.5 < z Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.0%
if -0.170000000000000012 < z < 1.5Initial program 99.2%
Taylor expanded in y around inf 98.7%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (<= z -5.4e-12) (* (- y x) (* 6.0 z)) (if (<= z 0.16) (+ x (* 6.0 (* z y))) (* 6.0 (* z (- y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.4e-12) {
tmp = (y - x) * (6.0 * z);
} else if (z <= 0.16) {
tmp = x + (6.0 * (z * y));
} else {
tmp = 6.0 * (z * (y - x));
}
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 <= (-5.4d-12)) then
tmp = (y - x) * (6.0d0 * z)
else if (z <= 0.16d0) then
tmp = x + (6.0d0 * (z * y))
else
tmp = 6.0d0 * (z * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.4e-12) {
tmp = (y - x) * (6.0 * z);
} else if (z <= 0.16) {
tmp = x + (6.0 * (z * y));
} else {
tmp = 6.0 * (z * (y - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.4e-12: tmp = (y - x) * (6.0 * z) elif z <= 0.16: tmp = x + (6.0 * (z * y)) else: tmp = 6.0 * (z * (y - x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.4e-12) tmp = Float64(Float64(y - x) * Float64(6.0 * z)); elseif (z <= 0.16) tmp = Float64(x + Float64(6.0 * Float64(z * y))); else tmp = Float64(6.0 * Float64(z * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.4e-12) tmp = (y - x) * (6.0 * z); elseif (z <= 0.16) tmp = x + (6.0 * (z * y)); else tmp = 6.0 * (z * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.4e-12], N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.16], N[(x + N[(6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-12}:\\
\;\;\;\;\left(y - x\right) \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;z \leq 0.16:\\
\;\;\;\;x + 6 \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if z < -5.39999999999999961e-12Initial program 99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.2%
Taylor expanded in y around 0 96.3%
*-commutative96.3%
associate-*r*96.3%
metadata-eval96.3%
distribute-lft-neg-in96.3%
distribute-lft-neg-in96.3%
distribute-rgt-neg-out96.3%
*-commutative96.3%
associate-*r*96.3%
distribute-lft-out99.2%
*-commutative99.2%
+-commutative99.2%
sub-neg99.2%
Simplified99.2%
if -5.39999999999999961e-12 < z < 0.160000000000000003Initial program 99.1%
Taylor expanded in y around inf 98.7%
*-commutative98.7%
Simplified98.7%
if 0.160000000000000003 < z Initial program 99.9%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.8%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.165) (not (<= z 1860.0))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.165) || !(z <= 1860.0)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
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.165d0)) .or. (.not. (z <= 1860.0d0))) then
tmp = (-6.0d0) * (x * z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.165) || !(z <= 1860.0)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.165) or not (z <= 1860.0): tmp = -6.0 * (x * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.165) || !(z <= 1860.0)) tmp = Float64(-6.0 * Float64(x * z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.165) || ~((z <= 1860.0))) tmp = -6.0 * (x * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.165], N[Not[LessEqual[z, 1860.0]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.165 \lor \neg \left(z \leq 1860\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.165000000000000008 or 1860 < z Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 99.0%
Taylor expanded in y around 0 46.3%
if -0.165000000000000008 < z < 1860Initial program 99.2%
Taylor expanded in z around 0 67.9%
Final simplification56.3%
(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 0 32.7%
Final simplification32.7%
(FPCore (x y z) :precision binary64 (- x (* (* 6.0 z) (- x y))))
double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x - ((6.0d0 * z) * (x - y))
end function
public static double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
def code(x, y, z): return x - ((6.0 * z) * (x - y))
function code(x, y, z) return Float64(x - Float64(Float64(6.0 * z) * Float64(x - y))) end
function tmp = code(x, y, z) tmp = x - ((6.0 * z) * (x - y)); end
code[x_, y_, z_] := N[(x - N[(N[(6.0 * z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(6 \cdot z\right) \cdot \left(x - y\right)
\end{array}
herbie shell --seed 2024080
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:alt
(- x (* (* 6.0 z) (- x y)))
(+ x (* (* (- y x) 6.0) z)))