
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (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.6%
+-commutative99.6%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -2.3e-12)
t_0
(if (<= z -1.05e-57)
(* x -3.0)
(if (<= z -6e-301)
(* y 4.0)
(if (<= z 1.12e-128) (* x -3.0) (if (<= z 0.5) (* 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 <= -2.3e-12) {
tmp = t_0;
} else if (z <= -1.05e-57) {
tmp = x * -3.0;
} else if (z <= -6e-301) {
tmp = y * 4.0;
} else if (z <= 1.12e-128) {
tmp = x * -3.0;
} else if (z <= 0.5) {
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 <= (-2.3d-12)) then
tmp = t_0
else if (z <= (-1.05d-57)) then
tmp = x * (-3.0d0)
else if (z <= (-6d-301)) then
tmp = y * 4.0d0
else if (z <= 1.12d-128) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) 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 <= -2.3e-12) {
tmp = t_0;
} else if (z <= -1.05e-57) {
tmp = x * -3.0;
} else if (z <= -6e-301) {
tmp = y * 4.0;
} else if (z <= 1.12e-128) {
tmp = x * -3.0;
} else if (z <= 0.5) {
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 <= -2.3e-12: tmp = t_0 elif z <= -1.05e-57: tmp = x * -3.0 elif z <= -6e-301: tmp = y * 4.0 elif z <= 1.12e-128: tmp = x * -3.0 elif z <= 0.5: 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 <= -2.3e-12) tmp = t_0; elseif (z <= -1.05e-57) tmp = Float64(x * -3.0); elseif (z <= -6e-301) tmp = Float64(y * 4.0); elseif (z <= 1.12e-128) tmp = Float64(x * -3.0); elseif (z <= 0.5) 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 <= -2.3e-12) tmp = t_0; elseif (z <= -1.05e-57) tmp = x * -3.0; elseif (z <= -6e-301) tmp = y * 4.0; elseif (z <= 1.12e-128) tmp = x * -3.0; elseif (z <= 0.5) 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, -2.3e-12], t$95$0, If[LessEqual[z, -1.05e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6e-301], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.12e-128], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], 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 -2.3 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-301}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.29999999999999989e-12 or 0.5 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 94.8%
if -2.29999999999999989e-12 < z < -1.05e-57 or -5.99999999999999998e-301 < z < 1.12e-128Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 69.6%
sub-neg69.6%
distribute-rgt-in69.6%
metadata-eval69.6%
distribute-lft-neg-in69.6%
associate-+r+69.6%
metadata-eval69.6%
distribute-rgt-neg-in69.6%
metadata-eval69.6%
Simplified69.6%
Taylor expanded in z around 0 69.5%
*-commutative69.5%
Simplified69.5%
if -1.05e-57 < z < -5.99999999999999998e-301 or 1.12e-128 < z < 0.5Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 62.9%
Taylor expanded in z around 0 62.9%
Final simplification80.1%
(FPCore (x y z)
:precision binary64
(if (<= z -0.5)
(* z (* x 6.0))
(if (<= z -1.1e-57)
(* x -3.0)
(if (<= z -1.6e-300)
(* y 4.0)
(if (<= z 2.05e-126)
(* x -3.0)
(if (<= z 0.5) (* y 4.0) (* x (* z 6.0))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.5) {
tmp = z * (x * 6.0);
} else if (z <= -1.1e-57) {
tmp = x * -3.0;
} else if (z <= -1.6e-300) {
tmp = y * 4.0;
} else if (z <= 2.05e-126) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.5d0)) then
tmp = z * (x * 6.0d0)
else if (z <= (-1.1d-57)) then
tmp = x * (-3.0d0)
else if (z <= (-1.6d-300)) then
tmp = y * 4.0d0
else if (z <= 2.05d-126) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = y * 4.0d0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.5) {
tmp = z * (x * 6.0);
} else if (z <= -1.1e-57) {
tmp = x * -3.0;
} else if (z <= -1.6e-300) {
tmp = y * 4.0;
} else if (z <= 2.05e-126) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.5: tmp = z * (x * 6.0) elif z <= -1.1e-57: tmp = x * -3.0 elif z <= -1.6e-300: tmp = y * 4.0 elif z <= 2.05e-126: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.5) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -1.1e-57) tmp = Float64(x * -3.0); elseif (z <= -1.6e-300) tmp = Float64(y * 4.0); elseif (z <= 2.05e-126) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.5) tmp = z * (x * 6.0); elseif (z <= -1.1e-57) tmp = x * -3.0; elseif (z <= -1.6e-300) tmp = y * 4.0; elseif (z <= 2.05e-126) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.5], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.6e-300], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.05e-126], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-126}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.5Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 63.1%
sub-neg63.1%
distribute-rgt-in63.1%
metadata-eval63.1%
distribute-lft-neg-in63.1%
associate-+r+63.1%
metadata-eval63.1%
distribute-rgt-neg-in63.1%
metadata-eval63.1%
Simplified63.1%
Taylor expanded in z around 0 63.1%
Taylor expanded in z around inf 61.8%
associate-*r*61.9%
*-commutative61.9%
*-commutative61.9%
Simplified61.9%
if -0.5 < z < -1.09999999999999999e-57 or -1.60000000000000011e-300 < z < 2.0499999999999999e-126Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 67.6%
sub-neg67.6%
distribute-rgt-in67.6%
metadata-eval67.6%
distribute-lft-neg-in67.6%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around 0 66.2%
*-commutative66.2%
Simplified66.2%
if -1.09999999999999999e-57 < z < -1.60000000000000011e-300 or 2.0499999999999999e-126 < z < 0.5Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 62.9%
Taylor expanded in z around 0 62.9%
if 0.5 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 64.8%
sub-neg64.8%
distribute-rgt-in64.8%
metadata-eval64.8%
distribute-lft-neg-in64.8%
associate-+r+64.8%
metadata-eval64.8%
distribute-rgt-neg-in64.8%
metadata-eval64.8%
Simplified64.8%
Taylor expanded in z around inf 62.6%
*-commutative62.6%
Simplified62.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -0.5)
t_0
(if (<= z -2.9e-57)
(* x -3.0)
(if (<= z -2.1e-300)
(* y 4.0)
(if (<= z 2.05e-126) (* x -3.0) (if (<= z 0.5) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -2.9e-57) {
tmp = x * -3.0;
} else if (z <= -2.1e-300) {
tmp = y * 4.0;
} else if (z <= 2.05e-126) {
tmp = x * -3.0;
} else if (z <= 0.5) {
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 = x * (z * 6.0d0)
if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= (-2.9d-57)) then
tmp = x * (-3.0d0)
else if (z <= (-2.1d-300)) then
tmp = y * 4.0d0
else if (z <= 2.05d-126) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -2.9e-57) {
tmp = x * -3.0;
} else if (z <= -2.1e-300) {
tmp = y * 4.0;
} else if (z <= 2.05e-126) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -0.5: tmp = t_0 elif z <= -2.9e-57: tmp = x * -3.0 elif z <= -2.1e-300: tmp = y * 4.0 elif z <= 2.05e-126: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -0.5) tmp = t_0; elseif (z <= -2.9e-57) tmp = Float64(x * -3.0); elseif (z <= -2.1e-300) tmp = Float64(y * 4.0); elseif (z <= 2.05e-126) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -0.5) tmp = t_0; elseif (z <= -2.9e-57) tmp = x * -3.0; elseif (z <= -2.1e-300) tmp = y * 4.0; elseif (z <= 2.05e-126) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -2.9e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.1e-300], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.05e-126], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-126}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.5 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 64.0%
sub-neg64.0%
distribute-rgt-in64.0%
metadata-eval64.0%
distribute-lft-neg-in64.0%
associate-+r+64.0%
metadata-eval64.0%
distribute-rgt-neg-in64.0%
metadata-eval64.0%
Simplified64.0%
Taylor expanded in z around inf 62.2%
*-commutative62.2%
Simplified62.2%
if -0.5 < z < -2.90000000000000025e-57 or -2.10000000000000004e-300 < z < 2.0499999999999999e-126Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 67.6%
sub-neg67.6%
distribute-rgt-in67.6%
metadata-eval67.6%
distribute-lft-neg-in67.6%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around 0 66.2%
*-commutative66.2%
Simplified66.2%
if -2.90000000000000025e-57 < z < -2.10000000000000004e-300 or 2.0499999999999999e-126 < z < 0.5Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 62.9%
Taylor expanded in z around 0 62.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -0.5)
t_0
(if (<= z -1.2e-57)
(* x -3.0)
(if (<= z -2.05e-300)
(* y 4.0)
(if (<= z 4.35e-128) (* x -3.0) (if (<= z 0.52) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -1.2e-57) {
tmp = x * -3.0;
} else if (z <= -2.05e-300) {
tmp = y * 4.0;
} else if (z <= 4.35e-128) {
tmp = x * -3.0;
} else if (z <= 0.52) {
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 * (x * z)
if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= (-1.2d-57)) then
tmp = x * (-3.0d0)
else if (z <= (-2.05d-300)) then
tmp = y * 4.0d0
else if (z <= 4.35d-128) then
tmp = x * (-3.0d0)
else if (z <= 0.52d0) 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 * (x * z);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -1.2e-57) {
tmp = x * -3.0;
} else if (z <= -2.05e-300) {
tmp = y * 4.0;
} else if (z <= 4.35e-128) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -0.5: tmp = t_0 elif z <= -1.2e-57: tmp = x * -3.0 elif z <= -2.05e-300: tmp = y * 4.0 elif z <= 4.35e-128: tmp = x * -3.0 elif z <= 0.52: tmp = y * 4.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 <= -0.5) tmp = t_0; elseif (z <= -1.2e-57) tmp = Float64(x * -3.0); elseif (z <= -2.05e-300) tmp = Float64(y * 4.0); elseif (z <= 4.35e-128) tmp = Float64(x * -3.0); elseif (z <= 0.52) tmp = Float64(y * 4.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 <= -0.5) tmp = t_0; elseif (z <= -1.2e-57) tmp = x * -3.0; elseif (z <= -2.05e-300) tmp = y * 4.0; elseif (z <= 4.35e-128) tmp = x * -3.0; elseif (z <= 0.52) 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[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -1.2e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.05e-300], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.35e-128], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.35 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.5 or 0.52000000000000002 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 64.0%
sub-neg64.0%
distribute-rgt-in64.0%
metadata-eval64.0%
distribute-lft-neg-in64.0%
associate-+r+64.0%
metadata-eval64.0%
distribute-rgt-neg-in64.0%
metadata-eval64.0%
Simplified64.0%
Taylor expanded in z around inf 61.5%
*-commutative61.5%
Simplified61.5%
if -0.5 < z < -1.20000000000000003e-57 or -2.05e-300 < z < 4.3500000000000001e-128Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 67.6%
sub-neg67.6%
distribute-rgt-in67.6%
metadata-eval67.6%
distribute-lft-neg-in67.6%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around 0 66.2%
*-commutative66.2%
Simplified66.2%
if -1.20000000000000003e-57 < z < -2.05e-300 or 4.3500000000000001e-128 < z < 0.52000000000000002Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 62.9%
Taylor expanded in z around 0 62.9%
Final simplification62.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -17.0)
t_0
(if (<= z -1.35e-56)
(* x -3.0)
(if (<= z -1.06e-300)
(* y 4.0)
(if (<= z 7.2e-127) (* x -3.0) (if (<= z 3.3e-6) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -17.0) {
tmp = t_0;
} else if (z <= -1.35e-56) {
tmp = x * -3.0;
} else if (z <= -1.06e-300) {
tmp = y * 4.0;
} else if (z <= 7.2e-127) {
tmp = x * -3.0;
} else if (z <= 3.3e-6) {
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 <= (-17.0d0)) then
tmp = t_0
else if (z <= (-1.35d-56)) then
tmp = x * (-3.0d0)
else if (z <= (-1.06d-300)) then
tmp = y * 4.0d0
else if (z <= 7.2d-127) then
tmp = x * (-3.0d0)
else if (z <= 3.3d-6) 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 <= -17.0) {
tmp = t_0;
} else if (z <= -1.35e-56) {
tmp = x * -3.0;
} else if (z <= -1.06e-300) {
tmp = y * 4.0;
} else if (z <= 7.2e-127) {
tmp = x * -3.0;
} else if (z <= 3.3e-6) {
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 <= -17.0: tmp = t_0 elif z <= -1.35e-56: tmp = x * -3.0 elif z <= -1.06e-300: tmp = y * 4.0 elif z <= 7.2e-127: tmp = x * -3.0 elif z <= 3.3e-6: 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 <= -17.0) tmp = t_0; elseif (z <= -1.35e-56) tmp = Float64(x * -3.0); elseif (z <= -1.06e-300) tmp = Float64(y * 4.0); elseif (z <= 7.2e-127) tmp = Float64(x * -3.0); elseif (z <= 3.3e-6) 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 <= -17.0) tmp = t_0; elseif (z <= -1.35e-56) tmp = x * -3.0; elseif (z <= -1.06e-300) tmp = y * 4.0; elseif (z <= 7.2e-127) tmp = x * -3.0; elseif (z <= 3.3e-6) 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, -17.0], t$95$0, If[LessEqual[z, -1.35e-56], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.06e-300], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.2e-127], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.3e-6], 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 -17:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-56}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-127}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-6}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -17 or 3.30000000000000017e-6 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 40.1%
Taylor expanded in z around inf 39.1%
if -17 < z < -1.34999999999999997e-56 or -1.05999999999999995e-300 < z < 7.1999999999999999e-127Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 67.6%
sub-neg67.6%
distribute-rgt-in67.6%
metadata-eval67.6%
distribute-lft-neg-in67.6%
associate-+r+67.7%
metadata-eval67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in z around 0 66.2%
*-commutative66.2%
Simplified66.2%
if -1.34999999999999997e-56 < z < -1.05999999999999995e-300 or 7.1999999999999999e-127 < z < 3.30000000000000017e-6Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 64.5%
Taylor expanded in z around 0 64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* -6.0 (* (- y x) z))))
(if (<= z -1980000.0)
t_1
(if (<= z -2.5e-225)
t_0
(if (<= z 2.35e-130) (* x -3.0) (if (<= z 290000000.0) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -1980000.0) {
tmp = t_1;
} else if (z <= -2.5e-225) {
tmp = t_0;
} else if (z <= 2.35e-130) {
tmp = x * -3.0;
} else if (z <= 290000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-1980000.0d0)) then
tmp = t_1
else if (z <= (-2.5d-225)) then
tmp = t_0
else if (z <= 2.35d-130) then
tmp = x * (-3.0d0)
else if (z <= 290000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -1980000.0) {
tmp = t_1;
} else if (z <= -2.5e-225) {
tmp = t_0;
} else if (z <= 2.35e-130) {
tmp = x * -3.0;
} else if (z <= 290000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -1980000.0: tmp = t_1 elif z <= -2.5e-225: tmp = t_0 elif z <= 2.35e-130: tmp = x * -3.0 elif z <= 290000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -1980000.0) tmp = t_1; elseif (z <= -2.5e-225) tmp = t_0; elseif (z <= 2.35e-130) tmp = Float64(x * -3.0); elseif (z <= 290000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -1980000.0) tmp = t_1; elseif (z <= -2.5e-225) tmp = t_0; elseif (z <= 2.35e-130) tmp = x * -3.0; elseif (z <= 290000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1980000.0], t$95$1, If[LessEqual[z, -2.5e-225], t$95$0, If[LessEqual[z, 2.35e-130], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 290000000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -1980000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-225}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-130}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 290000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.98e6 or 2.9e8 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.9%
if -1.98e6 < z < -2.5e-225 or 2.34999999999999984e-130 < z < 2.9e8Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 89.6%
Taylor expanded in y around inf 59.9%
if -2.5e-225 < z < 2.34999999999999984e-130Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 62.6%
sub-neg62.6%
distribute-rgt-in62.6%
metadata-eval62.6%
distribute-lft-neg-in62.6%
associate-+r+62.6%
metadata-eval62.6%
distribute-rgt-neg-in62.6%
metadata-eval62.6%
Simplified62.6%
Taylor expanded in z around 0 62.6%
*-commutative62.6%
Simplified62.6%
Final simplification78.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.5))) (* -6.0 (* (- y x) z)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.5)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = x + ((y - x) * 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.58d0)) .or. (.not. (z <= 0.5d0))) then
tmp = (-6.0d0) * ((y - x) * z)
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.5)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.5): tmp = -6.0 * ((y - x) * z) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.5)) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.5))) tmp = -6.0 * ((y - x) * z); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.5 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 96.8%
if -0.57999999999999996 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.7%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.5e+69) (not (<= y 1.2e+72))) (* 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+69) || !(y <= 1.2e+72)) {
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+69)) .or. (.not. (y <= 1.2d+72))) 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+69) || !(y <= 1.2e+72)) {
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+69) or not (y <= 1.2e+72): 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+69) || !(y <= 1.2e+72)) 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+69) || ~((y <= 1.2e+72))) 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+69], N[Not[LessEqual[y, 1.2e+72]], $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^{+69} \lor \neg \left(y \leq 1.2 \cdot 10^{+72}\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.50000000000000002e69 or 1.20000000000000005e72 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 79.5%
if -5.50000000000000002e69 < y < 1.20000000000000005e72Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 78.0%
sub-neg78.0%
distribute-rgt-in78.0%
metadata-eval78.0%
distribute-lft-neg-in78.0%
associate-+r+78.0%
metadata-eval78.0%
distribute-rgt-neg-in78.0%
metadata-eval78.0%
Simplified78.0%
Final simplification78.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -1e+70) (not (<= y 7e+72))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1e+70) || !(y <= 7e+72)) {
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 <= (-1d+70)) .or. (.not. (y <= 7d+72))) 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 <= -1e+70) || !(y <= 7e+72)) {
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 <= -1e+70) or not (y <= 7e+72): 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 <= -1e+70) || !(y <= 7e+72)) 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 <= -1e+70) || ~((y <= 7e+72))) 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, -1e+70], N[Not[LessEqual[y, 7e+72]], $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 -1 \cdot 10^{+70} \lor \neg \left(y \leq 7 \cdot 10^{+72}\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 < -1.00000000000000007e70 or 7.0000000000000002e72 < y Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 95.7%
Taylor expanded in y around inf 79.2%
if -1.00000000000000007e70 < y < 7.0000000000000002e72Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 78.0%
sub-neg78.0%
distribute-rgt-in78.0%
metadata-eval78.0%
distribute-lft-neg-in78.0%
associate-+r+78.0%
metadata-eval78.0%
distribute-rgt-neg-in78.0%
metadata-eval78.0%
Simplified78.0%
Final simplification78.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.35e-23) (not (<= x 4.5e-18))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.35e-23) || !(x <= 4.5e-18)) {
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 ((x <= (-1.35d-23)) .or. (.not. (x <= 4.5d-18))) 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 ((x <= -1.35e-23) || !(x <= 4.5e-18)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.35e-23) or not (x <= 4.5e-18): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.35e-23) || !(x <= 4.5e-18)) 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 ((x <= -1.35e-23) || ~((x <= 4.5e-18))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.35e-23], N[Not[LessEqual[x, 4.5e-18]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-23} \lor \neg \left(x \leq 4.5 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.34999999999999992e-23 or 4.49999999999999994e-18 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 79.5%
sub-neg79.5%
distribute-rgt-in79.5%
metadata-eval79.5%
distribute-lft-neg-in79.5%
associate-+r+79.5%
metadata-eval79.5%
distribute-rgt-neg-in79.5%
metadata-eval79.5%
Simplified79.5%
Taylor expanded in z around 0 39.9%
*-commutative39.9%
Simplified39.9%
if -1.34999999999999992e-23 < x < 4.49999999999999994e-18Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 74.5%
Taylor expanded in z around 0 49.5%
Final simplification44.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(Float64(y - x) * 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[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 57.1%
sub-neg57.1%
distribute-rgt-in57.1%
metadata-eval57.1%
distribute-lft-neg-in57.1%
associate-+r+57.1%
metadata-eval57.1%
distribute-rgt-neg-in57.1%
metadata-eval57.1%
Simplified57.1%
Taylor expanded in z around 0 26.9%
*-commutative26.9%
Simplified26.9%
herbie shell --seed 2024100
(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))))