
(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.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.04e+93)
(* 6.0 (* x z))
(if (<= z -1700.0)
t_0
(if (<= z -2.75e-186)
(* x -3.0)
(if (<= z -5.5e-207) (* y 4.0) (if (<= z 0.55) (* x -3.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.04e+93) {
tmp = 6.0 * (x * z);
} else if (z <= -1700.0) {
tmp = t_0;
} else if (z <= -2.75e-186) {
tmp = x * -3.0;
} else if (z <= -5.5e-207) {
tmp = y * 4.0;
} else if (z <= 0.55) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1.04d+93)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1700.0d0)) then
tmp = t_0
else if (z <= (-2.75d-186)) then
tmp = x * (-3.0d0)
else if (z <= (-5.5d-207)) then
tmp = y * 4.0d0
else if (z <= 0.55d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.04e+93) {
tmp = 6.0 * (x * z);
} else if (z <= -1700.0) {
tmp = t_0;
} else if (z <= -2.75e-186) {
tmp = x * -3.0;
} else if (z <= -5.5e-207) {
tmp = y * 4.0;
} else if (z <= 0.55) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.04e+93: tmp = 6.0 * (x * z) elif z <= -1700.0: tmp = t_0 elif z <= -2.75e-186: tmp = x * -3.0 elif z <= -5.5e-207: tmp = y * 4.0 elif z <= 0.55: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.04e+93) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1700.0) tmp = t_0; elseif (z <= -2.75e-186) tmp = Float64(x * -3.0); elseif (z <= -5.5e-207) tmp = Float64(y * 4.0); elseif (z <= 0.55) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.04e+93) tmp = 6.0 * (x * z); elseif (z <= -1700.0) tmp = t_0; elseif (z <= -2.75e-186) tmp = x * -3.0; elseif (z <= -5.5e-207) tmp = y * 4.0; elseif (z <= 0.55) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.04e+93], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1700.0], t$95$0, If[LessEqual[z, -2.75e-186], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.5e-207], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.04 \cdot 10^{+93}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1700:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-186}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.04e93Initial program 99.8%
associate-*r*99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
*-commutative99.9%
associate-*r*99.8%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 59.2%
if -1.04e93 < z < -1700 or 0.55000000000000004 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 58.4%
Taylor expanded in z around inf 57.9%
*-commutative57.9%
Simplified57.9%
if -1700 < z < -2.7500000000000001e-186 or -5.4999999999999997e-207 < z < 0.55000000000000004Initial program 99.3%
Taylor expanded in z around 0 96.7%
Taylor expanded in y around 0 59.2%
distribute-lft1-in59.2%
metadata-eval59.2%
*-commutative59.2%
Simplified59.2%
if -2.7500000000000001e-186 < z < -5.4999999999999997e-207Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification59.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -6.6e+93)
(* x (* z 6.0))
(if (<= z -1300.0)
t_0
(if (<= z -2.8e-188)
(* x -3.0)
(if (<= z -1.6e-206) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -6.6e+93) {
tmp = x * (z * 6.0);
} else if (z <= -1300.0) {
tmp = t_0;
} else if (z <= -2.8e-188) {
tmp = x * -3.0;
} else if (z <= -1.6e-206) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-6.6d+93)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1300.0d0)) then
tmp = t_0
else if (z <= (-2.8d-188)) then
tmp = x * (-3.0d0)
else if (z <= (-1.6d-206)) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -6.6e+93) {
tmp = x * (z * 6.0);
} else if (z <= -1300.0) {
tmp = t_0;
} else if (z <= -2.8e-188) {
tmp = x * -3.0;
} else if (z <= -1.6e-206) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -6.6e+93: tmp = x * (z * 6.0) elif z <= -1300.0: tmp = t_0 elif z <= -2.8e-188: tmp = x * -3.0 elif z <= -1.6e-206: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -6.6e+93) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1300.0) tmp = t_0; elseif (z <= -2.8e-188) tmp = Float64(x * -3.0); elseif (z <= -1.6e-206) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -6.6e+93) tmp = x * (z * 6.0); elseif (z <= -1300.0) tmp = t_0; elseif (z <= -2.8e-188) tmp = x * -3.0; elseif (z <= -1.6e-206) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+93], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1300.0], t$95$0, If[LessEqual[z, -2.8e-188], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.6e-206], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1300:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-188}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-206}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -6.60000000000000017e93Initial program 99.8%
associate-*r*99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
*-commutative99.9%
associate-*r*99.8%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 59.2%
associate-*r*59.2%
*-commutative59.2%
*-commutative59.2%
Simplified59.2%
if -6.60000000000000017e93 < z < -1300 or 0.5 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 58.4%
Taylor expanded in z around inf 57.9%
*-commutative57.9%
Simplified57.9%
if -1300 < z < -2.8000000000000001e-188 or -1.59999999999999988e-206 < z < 0.5Initial program 99.3%
Taylor expanded in z around 0 96.7%
Taylor expanded in y around 0 59.2%
distribute-lft1-in59.2%
metadata-eval59.2%
*-commutative59.2%
Simplified59.2%
if -2.8000000000000001e-188 < z < -1.59999999999999988e-206Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(if (<= z -9e+91)
(* x (* z 6.0))
(if (<= z -1300.0)
(* -6.0 (* y z))
(if (<= z -1.95e-188)
(* x -3.0)
(if (<= z -1.2e-206)
(* y 4.0)
(if (<= z 0.65) (* x -3.0) (* y (* z -6.0))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9e+91) {
tmp = x * (z * 6.0);
} else if (z <= -1300.0) {
tmp = -6.0 * (y * z);
} else if (z <= -1.95e-188) {
tmp = x * -3.0;
} else if (z <= -1.2e-206) {
tmp = y * 4.0;
} else if (z <= 0.65) {
tmp = x * -3.0;
} else {
tmp = y * (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 <= (-9d+91)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1300.0d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-1.95d-188)) then
tmp = x * (-3.0d0)
else if (z <= (-1.2d-206)) then
tmp = y * 4.0d0
else if (z <= 0.65d0) then
tmp = x * (-3.0d0)
else
tmp = y * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -9e+91) {
tmp = x * (z * 6.0);
} else if (z <= -1300.0) {
tmp = -6.0 * (y * z);
} else if (z <= -1.95e-188) {
tmp = x * -3.0;
} else if (z <= -1.2e-206) {
tmp = y * 4.0;
} else if (z <= 0.65) {
tmp = x * -3.0;
} else {
tmp = y * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9e+91: tmp = x * (z * 6.0) elif z <= -1300.0: tmp = -6.0 * (y * z) elif z <= -1.95e-188: tmp = x * -3.0 elif z <= -1.2e-206: tmp = y * 4.0 elif z <= 0.65: tmp = x * -3.0 else: tmp = y * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9e+91) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1300.0) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -1.95e-188) tmp = Float64(x * -3.0); elseif (z <= -1.2e-206) tmp = Float64(y * 4.0); elseif (z <= 0.65) tmp = Float64(x * -3.0); else tmp = Float64(y * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9e+91) tmp = x * (z * 6.0); elseif (z <= -1300.0) tmp = -6.0 * (y * z); elseif (z <= -1.95e-188) tmp = x * -3.0; elseif (z <= -1.2e-206) tmp = y * 4.0; elseif (z <= 0.65) tmp = x * -3.0; else tmp = y * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9e+91], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1300.0], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-188], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.2e-206], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(x * -3.0), $MachinePrecision], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+91}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1300:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-188}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-206}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -9e91Initial program 99.8%
associate-*r*99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
*-commutative99.9%
associate-*r*99.8%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 59.2%
associate-*r*59.2%
*-commutative59.2%
*-commutative59.2%
Simplified59.2%
if -9e91 < z < -1300Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-def99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
neg-mul-199.6%
associate-*r*99.6%
*-commutative99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 71.8%
Taylor expanded in z around inf 72.1%
*-commutative72.1%
Simplified72.1%
if -1300 < z < -1.94999999999999988e-188 or -1.2e-206 < z < 0.650000000000000022Initial program 99.3%
Taylor expanded in z around 0 96.7%
Taylor expanded in y around 0 59.2%
distribute-lft1-in59.2%
metadata-eval59.2%
*-commutative59.2%
Simplified59.2%
if -1.94999999999999988e-188 < z < -1.2e-206Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
Simplified85.8%
if 0.650000000000000022 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.1%
Taylor expanded in z around inf 55.5%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.00062)
t_0
(if (<= z -3.7e-188)
(* x -3.0)
(if (<= z -6.6e-207) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.00062) {
tmp = t_0;
} else if (z <= -3.7e-188) {
tmp = x * -3.0;
} else if (z <= -6.6e-207) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.00062d0)) then
tmp = t_0
else if (z <= (-3.7d-188)) then
tmp = x * (-3.0d0)
else if (z <= (-6.6d-207)) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.00062) {
tmp = t_0;
} else if (z <= -3.7e-188) {
tmp = x * -3.0;
} else if (z <= -6.6e-207) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.00062: tmp = t_0 elif z <= -3.7e-188: tmp = x * -3.0 elif z <= -6.6e-207: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.00062) tmp = t_0; elseif (z <= -3.7e-188) tmp = Float64(x * -3.0); elseif (z <= -6.6e-207) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.00062) tmp = t_0; elseif (z <= -3.7e-188) tmp = x * -3.0; elseif (z <= -6.6e-207) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.00062], t$95$0, If[LessEqual[z, -3.7e-188], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6.6e-207], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.00062:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-188}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -6.2e-4 or 0.5 < z Initial program 99.6%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 95.9%
if -6.2e-4 < z < -3.69999999999999972e-188 or -6.5999999999999996e-207 < z < 0.5Initial program 99.4%
Taylor expanded in z around 0 98.7%
Taylor expanded in y around 0 60.4%
distribute-lft1-in60.4%
metadata-eval60.4%
*-commutative60.4%
Simplified60.4%
if -3.69999999999999972e-188 < z < -6.5999999999999996e-207Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification79.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* -6.0 (* (- y x) z))))
(if (<= z -3000000.0)
t_1
(if (<= z -1.6e-187)
t_0
(if (<= z -1.3e-206) (* y 4.0) (if (<= z 260000000.0) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -3000000.0) {
tmp = t_1;
} else if (z <= -1.6e-187) {
tmp = t_0;
} else if (z <= -1.3e-206) {
tmp = y * 4.0;
} else if (z <= 260000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-3000000.0d0)) then
tmp = t_1
else if (z <= (-1.6d-187)) then
tmp = t_0
else if (z <= (-1.3d-206)) then
tmp = y * 4.0d0
else if (z <= 260000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -3000000.0) {
tmp = t_1;
} else if (z <= -1.6e-187) {
tmp = t_0;
} else if (z <= -1.3e-206) {
tmp = y * 4.0;
} else if (z <= 260000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -3000000.0: tmp = t_1 elif z <= -1.6e-187: tmp = t_0 elif z <= -1.3e-206: tmp = y * 4.0 elif z <= 260000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -3000000.0) tmp = t_1; elseif (z <= -1.6e-187) tmp = t_0; elseif (z <= -1.3e-206) tmp = Float64(y * 4.0); elseif (z <= 260000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -3000000.0) tmp = t_1; elseif (z <= -1.6e-187) tmp = t_0; elseif (z <= -1.3e-206) tmp = y * 4.0; elseif (z <= 260000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3000000.0], t$95$1, If[LessEqual[z, -1.6e-187], t$95$0, If[LessEqual[z, -1.3e-206], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 260000000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -3000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-187}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-206}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 260000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3e6 or 2.6e8 < z Initial program 99.7%
associate-*r*99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
*-commutative99.8%
associate-*r*99.7%
fma-def99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.2%
if -3e6 < z < -1.5999999999999999e-187 or -1.3e-206 < z < 2.6e8Initial program 99.3%
Taylor expanded in y around 0 62.3%
Taylor expanded in z around 0 62.6%
+-commutative62.6%
distribute-lft1-in62.6%
metadata-eval62.6%
associate-*r*62.6%
distribute-rgt-out62.6%
*-commutative62.6%
Simplified62.6%
if -1.5999999999999999e-187 < z < -1.3e-206Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification81.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1300.0)
t_0
(if (<= z -2.7e-188)
(* x -3.0)
(if (<= z -1.3e-206) (* y 4.0) (if (<= z 0.62) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1300.0) {
tmp = t_0;
} else if (z <= -2.7e-188) {
tmp = x * -3.0;
} else if (z <= -1.3e-206) {
tmp = y * 4.0;
} else if (z <= 0.62) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1300.0d0)) then
tmp = t_0
else if (z <= (-2.7d-188)) then
tmp = x * (-3.0d0)
else if (z <= (-1.3d-206)) then
tmp = y * 4.0d0
else if (z <= 0.62d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1300.0) {
tmp = t_0;
} else if (z <= -2.7e-188) {
tmp = x * -3.0;
} else if (z <= -1.3e-206) {
tmp = y * 4.0;
} else if (z <= 0.62) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1300.0: tmp = t_0 elif z <= -2.7e-188: tmp = x * -3.0 elif z <= -1.3e-206: tmp = y * 4.0 elif z <= 0.62: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1300.0) tmp = t_0; elseif (z <= -2.7e-188) tmp = Float64(x * -3.0); elseif (z <= -1.3e-206) tmp = Float64(y * 4.0); elseif (z <= 0.62) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1300.0) tmp = t_0; elseif (z <= -2.7e-188) tmp = x * -3.0; elseif (z <= -1.3e-206) tmp = y * 4.0; elseif (z <= 0.62) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1300.0], t$95$0, If[LessEqual[z, -2.7e-188], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.3e-206], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1300:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-188}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-206}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1300 or 0.619999999999999996 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 54.1%
Taylor expanded in z around inf 53.7%
*-commutative53.7%
Simplified53.7%
if -1300 < z < -2.7000000000000001e-188 or -1.3e-206 < z < 0.619999999999999996Initial program 99.3%
Taylor expanded in z around 0 96.7%
Taylor expanded in y around 0 59.2%
distribute-lft1-in59.2%
metadata-eval59.2%
*-commutative59.2%
Simplified59.2%
if -2.7000000000000001e-188 < z < -1.3e-206Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 85.8%
Taylor expanded in z around 0 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification57.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -7e-34) (not (<= x 2.9e+24))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -7e-34) || !(x <= 2.9e+24)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.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 ((x <= (-7d-34)) .or. (.not. (x <= 2.9d+24))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -7e-34) || !(x <= 2.9e+24)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -7e-34) or not (x <= 2.9e+24): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -7e-34) || !(x <= 2.9e+24)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -7e-34) || ~((x <= 2.9e+24))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -7e-34], N[Not[LessEqual[x, 2.9e+24]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-34} \lor \neg \left(x \leq 2.9 \cdot 10^{+24}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -7e-34 or 2.89999999999999979e24 < x Initial program 99.5%
Taylor expanded in y around 0 84.3%
Taylor expanded in z around 0 84.5%
+-commutative84.5%
distribute-lft1-in84.5%
metadata-eval84.5%
associate-*r*84.5%
distribute-rgt-out84.5%
*-commutative84.5%
Simplified84.5%
if -7e-34 < x < 2.89999999999999979e24Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 80.3%
Final simplification82.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.56) (not (<= z 0.65))) (* (- y x) (* z -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.56) || !(z <= 0.65)) {
tmp = (y - x) * (z * -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.56d0)) .or. (.not. (z <= 0.65d0))) then
tmp = (y - x) * (z * (-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.56) || !(z <= 0.65)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.56) or not (z <= 0.65): tmp = (y - x) * (z * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.56) || !(z <= 0.65)) tmp = Float64(Float64(y - x) * Float64(z * -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.56) || ~((z <= 0.65))) tmp = (y - x) * (z * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.56], N[Not[LessEqual[z, 0.65]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -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.56 \lor \neg \left(z \leq 0.65\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.650000000000000022 < z Initial program 99.6%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 97.1%
associate-*r*97.2%
*-commutative97.2%
*-commutative97.2%
*-commutative97.2%
Simplified97.2%
if -0.56000000000000005 < z < 0.650000000000000022Initial program 99.4%
Taylor expanded in z around 0 97.6%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.5%
Taylor expanded in z around 0 99.5%
neg-mul-199.5%
+-commutative99.5%
sub-neg99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) * (6.0d0 * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + ((y - x) * (6.0 * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.5%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= x -4.7e-35) (* x -3.0) (if (<= x 0.000225) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.7e-35) {
tmp = x * -3.0;
} else if (x <= 0.000225) {
tmp = y * 4.0;
} else {
tmp = x * -3.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.7d-35)) then
tmp = x * (-3.0d0)
else if (x <= 0.000225d0) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.7e-35) {
tmp = x * -3.0;
} else if (x <= 0.000225) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.7e-35: tmp = x * -3.0 elif x <= 0.000225: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.7e-35) tmp = Float64(x * -3.0); elseif (x <= 0.000225) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.7e-35) tmp = x * -3.0; elseif (x <= 0.000225) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.7e-35], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 0.000225], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-35}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 0.000225:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -4.7e-35 or 2.2499999999999999e-4 < x Initial program 99.5%
Taylor expanded in z around 0 54.1%
Taylor expanded in y around 0 45.1%
distribute-lft1-in45.1%
metadata-eval45.1%
*-commutative45.1%
Simplified45.1%
if -4.7e-35 < x < 2.2499999999999999e-4Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 81.3%
Taylor expanded in z around 0 34.9%
*-commutative34.9%
Simplified34.9%
Final simplification40.4%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
Taylor expanded in z around 0 48.5%
Taylor expanded in y around 0 28.9%
distribute-lft1-in28.9%
metadata-eval28.9%
*-commutative28.9%
Simplified28.9%
Final simplification28.9%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.5%
Taylor expanded in z around inf 51.5%
Taylor expanded in z around 0 2.7%
Final simplification2.7%
herbie shell --seed 2023187
(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))))