
(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) (+ 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.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z)))))
(if (<= y -1.06e-97)
t_0
(if (<= y -2.8e-199)
(* z (* x 6.0))
(if (<= y 6.2e-148)
(* x -3.0)
(if (<= y 5.7e-63) (* x (* z 6.0)) t_0))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -1.06e-97) {
tmp = t_0;
} else if (y <= -2.8e-199) {
tmp = z * (x * 6.0);
} else if (y <= 6.2e-148) {
tmp = x * -3.0;
} else if (y <= 5.7e-63) {
tmp = x * (z * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
if (y <= (-1.06d-97)) then
tmp = t_0
else if (y <= (-2.8d-199)) then
tmp = z * (x * 6.0d0)
else if (y <= 6.2d-148) then
tmp = x * (-3.0d0)
else if (y <= 5.7d-63) then
tmp = x * (z * 6.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -1.06e-97) {
tmp = t_0;
} else if (y <= -2.8e-199) {
tmp = z * (x * 6.0);
} else if (y <= 6.2e-148) {
tmp = x * -3.0;
} else if (y <= 5.7e-63) {
tmp = x * (z * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) tmp = 0 if y <= -1.06e-97: tmp = t_0 elif y <= -2.8e-199: tmp = z * (x * 6.0) elif y <= 6.2e-148: tmp = x * -3.0 elif y <= 5.7e-63: tmp = x * (z * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) tmp = 0.0 if (y <= -1.06e-97) tmp = t_0; elseif (y <= -2.8e-199) tmp = Float64(z * Float64(x * 6.0)); elseif (y <= 6.2e-148) tmp = Float64(x * -3.0); elseif (y <= 5.7e-63) tmp = Float64(x * Float64(z * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); tmp = 0.0; if (y <= -1.06e-97) tmp = t_0; elseif (y <= -2.8e-199) tmp = z * (x * 6.0); elseif (y <= 6.2e-148) tmp = x * -3.0; elseif (y <= 5.7e-63) tmp = x * (z * 6.0); else tmp = t_0; 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]}, If[LessEqual[y, -1.06e-97], t$95$0, If[LessEqual[y, -2.8e-199], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, 5.7e-63], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;y \leq -1.06 \cdot 10^{-97}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-199}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-148}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.06000000000000006e-97 or 5.70000000000000053e-63 < y Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-sqr-sqrt49.2%
fma-define49.2%
associate-*l*49.3%
Applied egg-rr49.3%
Taylor expanded in x around 0 73.4%
if -1.06000000000000006e-97 < y < -2.80000000000000018e-199Initial 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 0 97.2%
*-lft-identity97.2%
*-commutative97.2%
+-commutative97.2%
*-commutative97.2%
fma-define97.2%
associate-*r*97.2%
neg-mul-197.2%
fma-define97.2%
distribute-neg-in97.2%
distribute-lft-neg-in97.2%
metadata-eval97.2%
metadata-eval97.2%
distribute-rgt-in97.2%
+-commutative97.2%
sub-neg97.2%
distribute-rgt-in97.2%
sub-neg97.2%
distribute-rgt-in97.2%
metadata-eval97.2%
distribute-lft-neg-in97.2%
associate-+r+97.2%
Simplified97.2%
Taylor expanded in z around inf 73.4%
Taylor expanded in x around 0 73.5%
*-commutative73.5%
*-commutative73.5%
associate-*l*73.5%
Simplified73.5%
if -2.80000000000000018e-199 < y < 6.2000000000000003e-148Initial program 99.3%
+-commutative99.3%
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 0 88.1%
*-lft-identity88.1%
*-commutative88.1%
+-commutative88.1%
*-commutative88.1%
fma-define88.1%
associate-*r*88.1%
neg-mul-188.1%
fma-define88.1%
distribute-neg-in88.1%
distribute-lft-neg-in88.1%
metadata-eval88.1%
metadata-eval88.1%
distribute-rgt-in88.1%
+-commutative88.1%
sub-neg88.1%
distribute-rgt-in88.1%
sub-neg88.1%
distribute-rgt-in88.1%
metadata-eval88.1%
distribute-lft-neg-in88.1%
associate-+r+88.1%
Simplified88.1%
Taylor expanded in z around 0 57.7%
*-commutative57.7%
Simplified57.7%
if 6.2000000000000003e-148 < y < 5.70000000000000053e-63Initial program 99.5%
+-commutative99.5%
associate-*l*99.6%
fma-define99.6%
sub-neg99.6%
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 0 83.2%
*-lft-identity83.2%
*-commutative83.2%
+-commutative83.2%
*-commutative83.2%
fma-define83.2%
associate-*r*83.2%
neg-mul-183.2%
fma-define83.2%
distribute-neg-in83.2%
distribute-lft-neg-in83.2%
metadata-eval83.2%
metadata-eval83.2%
distribute-rgt-in83.2%
+-commutative83.2%
sub-neg83.2%
distribute-rgt-in83.2%
sub-neg83.2%
distribute-rgt-in83.3%
metadata-eval83.3%
distribute-lft-neg-in83.3%
associate-+r+83.3%
Simplified83.3%
Taylor expanded in z around inf 59.9%
Final simplification69.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))))
(if (<= z -7.1e-6)
t_0
(if (<= z -5.3e-129)
(* x -3.0)
(if (<= z 0.054) (* y 4.0) (if (<= z 2.4e+126) t_0 (* z (* x 6.0))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -5.3e-129) {
tmp = x * -3.0;
} else if (z <= 0.054) {
tmp = y * 4.0;
} else if (z <= 2.4e+126) {
tmp = t_0;
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
if (z <= (-7.1d-6)) then
tmp = t_0
else if (z <= (-5.3d-129)) then
tmp = x * (-3.0d0)
else if (z <= 0.054d0) then
tmp = y * 4.0d0
else if (z <= 2.4d+126) then
tmp = t_0
else
tmp = z * (x * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -5.3e-129) {
tmp = x * -3.0;
} else if (z <= 0.054) {
tmp = y * 4.0;
} else if (z <= 2.4e+126) {
tmp = t_0;
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) tmp = 0 if z <= -7.1e-6: tmp = t_0 elif z <= -5.3e-129: tmp = x * -3.0 elif z <= 0.054: tmp = y * 4.0 elif z <= 2.4e+126: tmp = t_0 else: tmp = z * (x * 6.0) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (z <= -7.1e-6) tmp = t_0; elseif (z <= -5.3e-129) tmp = Float64(x * -3.0); elseif (z <= 0.054) tmp = Float64(y * 4.0); elseif (z <= 2.4e+126) tmp = t_0; else tmp = Float64(z * Float64(x * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); tmp = 0.0; if (z <= -7.1e-6) tmp = t_0; elseif (z <= -5.3e-129) tmp = x * -3.0; elseif (z <= 0.054) tmp = y * 4.0; elseif (z <= 2.4e+126) tmp = t_0; else tmp = z * (x * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.1e-6], t$95$0, If[LessEqual[z, -5.3e-129], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.054], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.4e+126], t$95$0, N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -7.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-129}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.054:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+126}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -7.0999999999999998e-6 or 0.0539999999999999994 < z < 2.40000000000000012e126Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 60.5%
Taylor expanded in z around inf 57.6%
*-commutative57.6%
Simplified57.6%
if -7.0999999999999998e-6 < z < -5.29999999999999974e-129Initial program 99.1%
+-commutative99.1%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 76.9%
*-lft-identity76.9%
*-commutative76.9%
+-commutative76.9%
*-commutative76.9%
fma-define76.9%
associate-*r*76.9%
neg-mul-176.9%
fma-define76.9%
distribute-neg-in76.9%
distribute-lft-neg-in76.9%
metadata-eval76.9%
metadata-eval76.9%
distribute-rgt-in76.9%
+-commutative76.9%
sub-neg76.9%
distribute-rgt-in76.9%
sub-neg76.9%
distribute-rgt-in76.9%
metadata-eval76.9%
distribute-lft-neg-in76.9%
associate-+r+77.0%
Simplified77.0%
Taylor expanded in z around 0 75.2%
*-commutative75.2%
Simplified75.2%
if -5.29999999999999974e-129 < z < 0.0539999999999999994Initial program 99.4%
+-commutative99.4%
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 57.1%
Taylor expanded in z around 0 56.7%
*-commutative56.7%
Simplified56.7%
if 2.40000000000000012e126 < 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 y around 0 58.9%
*-lft-identity58.9%
*-commutative58.9%
+-commutative58.9%
*-commutative58.9%
fma-define58.9%
associate-*r*58.9%
neg-mul-158.9%
fma-define58.9%
distribute-neg-in58.9%
distribute-lft-neg-in58.9%
metadata-eval58.9%
metadata-eval58.9%
distribute-rgt-in58.9%
+-commutative58.9%
sub-neg58.9%
distribute-rgt-in58.9%
sub-neg58.9%
distribute-rgt-in58.9%
metadata-eval58.9%
distribute-lft-neg-in58.9%
associate-+r+58.9%
Simplified58.9%
Taylor expanded in z around inf 58.9%
Taylor expanded in x around 0 58.9%
*-commutative58.9%
*-commutative58.9%
associate-*l*59.0%
Simplified59.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))))
(if (<= z -7.1e-6)
t_0
(if (<= z -1.35e-128)
(* x -3.0)
(if (<= z 0.054)
(* y 4.0)
(if (<= z 1.25e+127) t_0 (* x (* z 6.0))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -1.35e-128) {
tmp = x * -3.0;
} else if (z <= 0.054) {
tmp = y * 4.0;
} else if (z <= 1.25e+127) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
if (z <= (-7.1d-6)) then
tmp = t_0
else if (z <= (-1.35d-128)) then
tmp = x * (-3.0d0)
else if (z <= 0.054d0) then
tmp = y * 4.0d0
else if (z <= 1.25d+127) then
tmp = t_0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -1.35e-128) {
tmp = x * -3.0;
} else if (z <= 0.054) {
tmp = y * 4.0;
} else if (z <= 1.25e+127) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) tmp = 0 if z <= -7.1e-6: tmp = t_0 elif z <= -1.35e-128: tmp = x * -3.0 elif z <= 0.054: tmp = y * 4.0 elif z <= 1.25e+127: tmp = t_0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (z <= -7.1e-6) tmp = t_0; elseif (z <= -1.35e-128) tmp = Float64(x * -3.0); elseif (z <= 0.054) tmp = Float64(y * 4.0); elseif (z <= 1.25e+127) tmp = t_0; else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); tmp = 0.0; if (z <= -7.1e-6) tmp = t_0; elseif (z <= -1.35e-128) tmp = x * -3.0; elseif (z <= 0.054) tmp = y * 4.0; elseif (z <= 1.25e+127) tmp = t_0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.1e-6], t$95$0, If[LessEqual[z, -1.35e-128], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.054], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.25e+127], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -7.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.054:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+127}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -7.0999999999999998e-6 or 0.0539999999999999994 < z < 1.2500000000000001e127Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 60.5%
Taylor expanded in z around inf 57.6%
*-commutative57.6%
Simplified57.6%
if -7.0999999999999998e-6 < z < -1.35000000000000003e-128Initial program 99.1%
+-commutative99.1%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 76.9%
*-lft-identity76.9%
*-commutative76.9%
+-commutative76.9%
*-commutative76.9%
fma-define76.9%
associate-*r*76.9%
neg-mul-176.9%
fma-define76.9%
distribute-neg-in76.9%
distribute-lft-neg-in76.9%
metadata-eval76.9%
metadata-eval76.9%
distribute-rgt-in76.9%
+-commutative76.9%
sub-neg76.9%
distribute-rgt-in76.9%
sub-neg76.9%
distribute-rgt-in76.9%
metadata-eval76.9%
distribute-lft-neg-in76.9%
associate-+r+77.0%
Simplified77.0%
Taylor expanded in z around 0 75.2%
*-commutative75.2%
Simplified75.2%
if -1.35000000000000003e-128 < z < 0.0539999999999999994Initial program 99.4%
+-commutative99.4%
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 57.1%
Taylor expanded in z around 0 56.7%
*-commutative56.7%
Simplified56.7%
if 1.2500000000000001e127 < 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 y around 0 58.9%
*-lft-identity58.9%
*-commutative58.9%
+-commutative58.9%
*-commutative58.9%
fma-define58.9%
associate-*r*58.9%
neg-mul-158.9%
fma-define58.9%
distribute-neg-in58.9%
distribute-lft-neg-in58.9%
metadata-eval58.9%
metadata-eval58.9%
distribute-rgt-in58.9%
+-commutative58.9%
sub-neg58.9%
distribute-rgt-in58.9%
sub-neg58.9%
distribute-rgt-in58.9%
metadata-eval58.9%
distribute-lft-neg-in58.9%
associate-+r+58.9%
Simplified58.9%
Taylor expanded in z around inf 58.9%
Final simplification59.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -7.1e-6)
t_0
(if (<= z -3e-128)
(* x -3.0)
(if (<= z 0.054)
(* y 4.0)
(if (<= z 2.15e+128) t_0 (* x (* z 6.0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -3e-128) {
tmp = x * -3.0;
} else if (z <= 0.054) {
tmp = y * 4.0;
} else if (z <= 2.15e+128) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-7.1d-6)) then
tmp = t_0
else if (z <= (-3d-128)) then
tmp = x * (-3.0d0)
else if (z <= 0.054d0) then
tmp = y * 4.0d0
else if (z <= 2.15d+128) then
tmp = t_0
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -3e-128) {
tmp = x * -3.0;
} else if (z <= 0.054) {
tmp = y * 4.0;
} else if (z <= 2.15e+128) {
tmp = t_0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -7.1e-6: tmp = t_0 elif z <= -3e-128: tmp = x * -3.0 elif z <= 0.054: tmp = y * 4.0 elif z <= 2.15e+128: tmp = t_0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -7.1e-6) tmp = t_0; elseif (z <= -3e-128) tmp = Float64(x * -3.0); elseif (z <= 0.054) tmp = Float64(y * 4.0); elseif (z <= 2.15e+128) tmp = t_0; else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -7.1e-6) tmp = t_0; elseif (z <= -3e-128) tmp = x * -3.0; elseif (z <= 0.054) tmp = y * 4.0; elseif (z <= 2.15e+128) tmp = t_0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.1e-6], t$95$0, If[LessEqual[z, -3e-128], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.054], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.15e+128], t$95$0, N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -7.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-128}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.054:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+128}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -7.0999999999999998e-6 or 0.0539999999999999994 < z < 2.14999999999999987e128Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 60.5%
Taylor expanded in z around inf 57.5%
if -7.0999999999999998e-6 < z < -2.99999999999999978e-128Initial program 99.1%
+-commutative99.1%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 76.9%
*-lft-identity76.9%
*-commutative76.9%
+-commutative76.9%
*-commutative76.9%
fma-define76.9%
associate-*r*76.9%
neg-mul-176.9%
fma-define76.9%
distribute-neg-in76.9%
distribute-lft-neg-in76.9%
metadata-eval76.9%
metadata-eval76.9%
distribute-rgt-in76.9%
+-commutative76.9%
sub-neg76.9%
distribute-rgt-in76.9%
sub-neg76.9%
distribute-rgt-in76.9%
metadata-eval76.9%
distribute-lft-neg-in76.9%
associate-+r+77.0%
Simplified77.0%
Taylor expanded in z around 0 75.2%
*-commutative75.2%
Simplified75.2%
if -2.99999999999999978e-128 < z < 0.0539999999999999994Initial program 99.4%
+-commutative99.4%
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 57.1%
Taylor expanded in z around 0 56.7%
*-commutative56.7%
Simplified56.7%
if 2.14999999999999987e128 < 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 y around 0 58.9%
*-lft-identity58.9%
*-commutative58.9%
+-commutative58.9%
*-commutative58.9%
fma-define58.9%
associate-*r*58.9%
neg-mul-158.9%
fma-define58.9%
distribute-neg-in58.9%
distribute-lft-neg-in58.9%
metadata-eval58.9%
metadata-eval58.9%
distribute-rgt-in58.9%
+-commutative58.9%
sub-neg58.9%
distribute-rgt-in58.9%
sub-neg58.9%
distribute-rgt-in58.9%
metadata-eval58.9%
distribute-lft-neg-in58.9%
associate-+r+58.9%
Simplified58.9%
Taylor expanded in z around inf 58.9%
Final simplification59.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -7.1e-6)
t_0
(if (<= z -2.35e-127) (* x -3.0) (if (<= z 0.054) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -7.1e-6) {
tmp = t_0;
} else if (z <= -2.35e-127) {
tmp = x * -3.0;
} else if (z <= 0.054) {
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 <= (-7.1d-6)) then
tmp = t_0
else if (z <= (-2.35d-127)) then
tmp = x * (-3.0d0)
else if (z <= 0.054d0) 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 <= -7.1e-6) {
tmp = t_0;
} else if (z <= -2.35e-127) {
tmp = x * -3.0;
} else if (z <= 0.054) {
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 <= -7.1e-6: tmp = t_0 elif z <= -2.35e-127: tmp = x * -3.0 elif z <= 0.054: 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 <= -7.1e-6) tmp = t_0; elseif (z <= -2.35e-127) tmp = Float64(x * -3.0); elseif (z <= 0.054) 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 <= -7.1e-6) tmp = t_0; elseif (z <= -2.35e-127) tmp = x * -3.0; elseif (z <= 0.054) 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, -7.1e-6], t$95$0, If[LessEqual[z, -2.35e-127], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.054], 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 -7.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-127}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.054:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.0999999999999998e-6 or 0.0539999999999999994 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.5%
Taylor expanded in z around inf 54.1%
if -7.0999999999999998e-6 < z < -2.35000000000000001e-127Initial program 99.1%
+-commutative99.1%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 76.9%
*-lft-identity76.9%
*-commutative76.9%
+-commutative76.9%
*-commutative76.9%
fma-define76.9%
associate-*r*76.9%
neg-mul-176.9%
fma-define76.9%
distribute-neg-in76.9%
distribute-lft-neg-in76.9%
metadata-eval76.9%
metadata-eval76.9%
distribute-rgt-in76.9%
+-commutative76.9%
sub-neg76.9%
distribute-rgt-in76.9%
sub-neg76.9%
distribute-rgt-in76.9%
metadata-eval76.9%
distribute-lft-neg-in76.9%
associate-+r+77.0%
Simplified77.0%
Taylor expanded in z around 0 75.2%
*-commutative75.2%
Simplified75.2%
if -2.35000000000000001e-127 < z < 0.0539999999999999994Initial program 99.4%
+-commutative99.4%
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 57.1%
Taylor expanded in z around 0 56.7%
*-commutative56.7%
Simplified56.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.56))) (* z (* (- y x) -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.56)) {
tmp = z * ((y - x) * -6.0);
} 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.56d0))) then
tmp = z * ((y - x) * (-6.0d0))
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.56)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.56): tmp = z * ((y - x) * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.56)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); 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.56))) tmp = z * ((y - x) * -6.0); 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.56]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $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.56\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.56000000000000005 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-sqr-sqrt50.7%
fma-define50.7%
associate-*l*50.7%
Applied egg-rr50.7%
Taylor expanded in z around inf 98.2%
associate-*r*98.3%
*-commutative98.3%
associate-*r*98.3%
Simplified98.3%
if -0.57999999999999996 < z < 0.56000000000000005Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 96.8%
Final simplification97.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.22e+86) (not (<= y 1.38e-52))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.22e+86) || !(y <= 1.38e-52)) {
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 <= (-1.22d+86)) .or. (.not. (y <= 1.38d-52))) 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 <= -1.22e+86) || !(y <= 1.38e-52)) {
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 <= -1.22e+86) or not (y <= 1.38e-52): 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 <= -1.22e+86) || !(y <= 1.38e-52)) 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 <= -1.22e+86) || ~((y <= 1.38e-52))) 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, -1.22e+86], N[Not[LessEqual[y, 1.38e-52]], $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 -1.22 \cdot 10^{+86} \lor \neg \left(y \leq 1.38 \cdot 10^{-52}\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 < -1.21999999999999996e86 or 1.38000000000000008e-52 < y Initial program 99.6%
+-commutative99.6%
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 80.9%
if -1.21999999999999996e86 < y < 1.38000000000000008e-52Initial program 99.5%
+-commutative99.5%
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 0 76.4%
*-lft-identity76.4%
*-commutative76.4%
+-commutative76.4%
*-commutative76.4%
fma-define76.3%
associate-*r*76.3%
neg-mul-176.3%
fma-define76.4%
distribute-neg-in76.4%
distribute-lft-neg-in76.4%
metadata-eval76.4%
metadata-eval76.4%
distribute-rgt-in76.4%
+-commutative76.4%
sub-neg76.4%
distribute-rgt-in76.4%
sub-neg76.4%
distribute-rgt-in76.4%
metadata-eval76.4%
distribute-lft-neg-in76.4%
associate-+r+76.4%
Simplified76.4%
Final simplification78.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.35e+86) (not (<= y 3e-52))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.35e+86) || !(y <= 3e-52)) {
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 <= (-1.35d+86)) .or. (.not. (y <= 3d-52))) 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 <= -1.35e+86) || !(y <= 3e-52)) {
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 <= -1.35e+86) or not (y <= 3e-52): 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 <= -1.35e+86) || !(y <= 3e-52)) 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 <= -1.35e+86) || ~((y <= 3e-52))) 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, -1.35e+86], N[Not[LessEqual[y, 3e-52]], $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.35 \cdot 10^{+86} \lor \neg \left(y \leq 3 \cdot 10^{-52}\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.35000000000000009e86 or 3e-52 < y Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-sqr-sqrt49.8%
fma-define49.8%
associate-*l*50.0%
Applied egg-rr50.0%
Taylor expanded in x around 0 80.8%
if -1.35000000000000009e86 < y < 3e-52Initial program 99.5%
+-commutative99.5%
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 0 76.4%
*-lft-identity76.4%
*-commutative76.4%
+-commutative76.4%
*-commutative76.4%
fma-define76.3%
associate-*r*76.3%
neg-mul-176.3%
fma-define76.4%
distribute-neg-in76.4%
distribute-lft-neg-in76.4%
metadata-eval76.4%
metadata-eval76.4%
distribute-rgt-in76.4%
+-commutative76.4%
sub-neg76.4%
distribute-rgt-in76.4%
sub-neg76.4%
distribute-rgt-in76.4%
metadata-eval76.4%
distribute-lft-neg-in76.4%
associate-+r+76.4%
Simplified76.4%
Final simplification78.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.65) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.65) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.66d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.65d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.65) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.65: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.65) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.65) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.8%
Simplified99.8%
if -0.660000000000000031 < z < 0.650000000000000022Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 96.8%
if 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
add-sqr-sqrt55.4%
fma-define55.4%
associate-*l*55.4%
Applied egg-rr55.4%
Taylor expanded in z around inf 96.8%
associate-*r*96.9%
*-commutative96.9%
associate-*r*96.9%
Simplified96.9%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* (- y x) z)) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((-6.0d0) * ((y - x) * z)) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(Float64(y - x) * z)) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.5e-14) (not (<= x 1.18e+57))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.5e-14) || !(x <= 1.18e+57)) {
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 <= (-4.5d-14)) .or. (.not. (x <= 1.18d+57))) 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 <= -4.5e-14) || !(x <= 1.18e+57)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.5e-14) or not (x <= 1.18e+57): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.5e-14) || !(x <= 1.18e+57)) 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 <= -4.5e-14) || ~((x <= 1.18e+57))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.5e-14], N[Not[LessEqual[x, 1.18e+57]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-14} \lor \neg \left(x \leq 1.18 \cdot 10^{+57}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -4.4999999999999998e-14 or 1.18e57 < x Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 76.0%
*-lft-identity76.0%
*-commutative76.0%
+-commutative76.0%
*-commutative76.0%
fma-define76.0%
associate-*r*76.0%
neg-mul-176.0%
fma-define76.0%
distribute-neg-in76.0%
distribute-lft-neg-in76.0%
metadata-eval76.0%
metadata-eval76.0%
distribute-rgt-in76.0%
+-commutative76.0%
sub-neg76.0%
distribute-rgt-in76.0%
sub-neg76.0%
distribute-rgt-in76.0%
metadata-eval76.0%
distribute-lft-neg-in76.0%
associate-+r+76.0%
Simplified76.0%
Taylor expanded in z around 0 41.6%
*-commutative41.6%
Simplified41.6%
if -4.4999999999999998e-14 < x < 1.18e57Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 73.6%
Taylor expanded in z around 0 39.9%
*-commutative39.9%
Simplified39.9%
Final simplification40.7%
(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.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 50.0%
*-lft-identity50.0%
*-commutative50.0%
+-commutative50.0%
*-commutative50.0%
fma-define49.9%
associate-*r*49.9%
neg-mul-149.9%
fma-define50.0%
distribute-neg-in50.0%
distribute-lft-neg-in50.0%
metadata-eval50.0%
metadata-eval50.0%
distribute-rgt-in50.0%
+-commutative50.0%
sub-neg50.0%
distribute-rgt-in50.0%
sub-neg50.0%
distribute-rgt-in50.0%
metadata-eval50.0%
distribute-lft-neg-in50.0%
associate-+r+50.0%
Simplified50.0%
Taylor expanded in z around 0 26.7%
*-commutative26.7%
Simplified26.7%
(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%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 53.1%
Taylor expanded in x around inf 2.6%
herbie shell --seed 2024135
(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))))