
(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 16 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 (+ x (fma (* z (- y x)) -6.0 (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + fma((z * (y - x)), -6.0, ((y - x) * 4.0));
}
function code(x, y, z) return Float64(x + fma(Float64(z * Float64(y - x)), -6.0, Float64(Float64(y - x) * 4.0))) end
code[x_, y_, z_] := N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * -6.0 + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \mathsf{fma}\left(z \cdot \left(y - x\right), -6, \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
*-commutative99.8%
fma-define99.8%
*-commutative99.8%
Applied egg-rr99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -3.9e+149)
(* 6.0 (* x z))
(if (<= z -0.0088)
(* y (* z -6.0))
(if (<= z -2.25e-136)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* z (* x 6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.9e+149) {
tmp = 6.0 * (x * z);
} else if (z <= -0.0088) {
tmp = y * (z * -6.0);
} else if (z <= -2.25e-136) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.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) :: tmp
if (z <= (-3.9d+149)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-0.0088d0)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-2.25d-136)) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = z * (x * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.9e+149) {
tmp = 6.0 * (x * z);
} else if (z <= -0.0088) {
tmp = y * (z * -6.0);
} else if (z <= -2.25e-136) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.9e+149: tmp = 6.0 * (x * z) elif z <= -0.0088: tmp = y * (z * -6.0) elif z <= -2.25e-136: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = z * (x * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.9e+149) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -0.0088) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -2.25e-136) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(z * Float64(x * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.9e+149) tmp = 6.0 * (x * z); elseif (z <= -0.0088) tmp = y * (z * -6.0); elseif (z <= -2.25e-136) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = z * (x * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.9e+149], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.0088], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.25e-136], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+149}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -0.0088:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-136}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -3.8999999999999999e149Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 59.8%
Taylor expanded in z around inf 59.8%
if -3.8999999999999999e149 < z < -0.00880000000000000053Initial program 99.6%
+-commutative99.6%
associate-*l*99.4%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.2%
Taylor expanded in z around inf 65.2%
*-commutative65.2%
associate-*r*65.4%
*-commutative65.4%
Simplified65.4%
if -0.00880000000000000053 < z < -2.24999999999999986e-136Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
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 56.5%
*-lft-identity56.5%
*-commutative56.5%
+-commutative56.5%
*-commutative56.5%
fma-define56.5%
associate-*r*56.5%
fma-define56.5%
distribute-lft-in56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
metadata-eval56.5%
metadata-eval56.5%
distribute-rgt-in56.5%
+-commutative56.5%
sub-neg56.5%
distribute-rgt-in56.5%
sub-neg56.5%
distribute-rgt-in56.5%
metadata-eval56.5%
distribute-lft-neg-in56.5%
associate-+r+56.6%
Simplified56.6%
Taylor expanded in z around 0 52.9%
*-commutative52.9%
Simplified52.9%
if -2.24999999999999986e-136 < z < 0.650000000000000022Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
if 0.650000000000000022 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 57.4%
Taylor expanded in z around inf 55.7%
associate-*r*55.9%
*-commutative55.9%
Simplified55.9%
Final simplification58.0%
(FPCore (x y z)
:precision binary64
(if (<= z -2.2e+149)
(* 6.0 (* x z))
(if (<= z -1.5)
(* y (* z -6.0))
(if (<= z -1.6e-131)
(* 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 <= -2.2e+149) {
tmp = 6.0 * (x * z);
} else if (z <= -1.5) {
tmp = y * (z * -6.0);
} else if (z <= -1.6e-131) {
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 <= (-2.2d+149)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1.5d0)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-1.6d-131)) 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 <= -2.2e+149) {
tmp = 6.0 * (x * z);
} else if (z <= -1.5) {
tmp = y * (z * -6.0);
} else if (z <= -1.6e-131) {
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 <= -2.2e+149: tmp = 6.0 * (x * z) elif z <= -1.5: tmp = y * (z * -6.0) elif z <= -1.6e-131: 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 <= -2.2e+149) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1.5) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -1.6e-131) 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 <= -2.2e+149) tmp = 6.0 * (x * z); elseif (z <= -1.5) tmp = y * (z * -6.0); elseif (z <= -1.6e-131) 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, -2.2e+149], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-131], 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 -2.2 \cdot 10^{+149}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1.5:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-131}:\\
\;\;\;\;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 < -2.2e149Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 59.8%
Taylor expanded in z around inf 59.8%
if -2.2e149 < z < -1.5Initial program 99.6%
+-commutative99.6%
associate-*l*99.4%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.2%
Taylor expanded in z around inf 65.2%
*-commutative65.2%
associate-*r*65.4%
*-commutative65.4%
Simplified65.4%
if -1.5 < z < -1.6e-131Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
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 56.5%
*-lft-identity56.5%
*-commutative56.5%
+-commutative56.5%
*-commutative56.5%
fma-define56.5%
associate-*r*56.5%
fma-define56.5%
distribute-lft-in56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
metadata-eval56.5%
metadata-eval56.5%
distribute-rgt-in56.5%
+-commutative56.5%
sub-neg56.5%
distribute-rgt-in56.5%
sub-neg56.5%
distribute-rgt-in56.5%
metadata-eval56.5%
distribute-lft-neg-in56.5%
associate-+r+56.6%
Simplified56.6%
Taylor expanded in z around 0 52.9%
*-commutative52.9%
Simplified52.9%
if -1.6e-131 < z < 0.5Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
if 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 y around 0 57.3%
*-lft-identity57.3%
*-commutative57.3%
+-commutative57.3%
*-commutative57.3%
fma-define57.2%
associate-*r*57.2%
fma-define57.3%
distribute-lft-in57.3%
neg-mul-157.3%
distribute-lft-neg-in57.3%
metadata-eval57.3%
metadata-eval57.3%
distribute-rgt-in57.3%
+-commutative57.3%
sub-neg57.3%
distribute-rgt-in57.3%
sub-neg57.3%
distribute-rgt-in57.3%
metadata-eval57.3%
distribute-lft-neg-in57.3%
associate-+r+57.3%
Simplified57.3%
Taylor expanded in z around inf 55.8%
Final simplification57.9%
(FPCore (x y z)
:precision binary64
(if (<= z -4.4e+154)
(* 6.0 (* x z))
(if (<= z -0.062)
(* -6.0 (* z y))
(if (<= z -5.8e-134)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* x (* z 6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.4e+154) {
tmp = 6.0 * (x * z);
} else if (z <= -0.062) {
tmp = -6.0 * (z * y);
} else if (z <= -5.8e-134) {
tmp = x * -3.0;
} else if (z <= 0.65) {
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 <= (-4.4d+154)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-0.062d0)) then
tmp = (-6.0d0) * (z * y)
else if (z <= (-5.8d-134)) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) 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 <= -4.4e+154) {
tmp = 6.0 * (x * z);
} else if (z <= -0.062) {
tmp = -6.0 * (z * y);
} else if (z <= -5.8e-134) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.4e+154: tmp = 6.0 * (x * z) elif z <= -0.062: tmp = -6.0 * (z * y) elif z <= -5.8e-134: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.4e+154) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -0.062) tmp = Float64(-6.0 * Float64(z * y)); elseif (z <= -5.8e-134) tmp = Float64(x * -3.0); elseif (z <= 0.65) 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 <= -4.4e+154) tmp = 6.0 * (x * z); elseif (z <= -0.062) tmp = -6.0 * (z * y); elseif (z <= -5.8e-134) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.4e+154], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.062], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-134], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+154}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -0.062:\\
\;\;\;\;-6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-134}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -4.4000000000000002e154Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 59.8%
Taylor expanded in z around inf 59.8%
if -4.4000000000000002e154 < z < -0.062Initial program 99.6%
+-commutative99.6%
associate-*l*99.4%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.2%
Taylor expanded in z around inf 65.2%
if -0.062 < z < -5.79999999999999986e-134Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
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 56.5%
*-lft-identity56.5%
*-commutative56.5%
+-commutative56.5%
*-commutative56.5%
fma-define56.5%
associate-*r*56.5%
fma-define56.5%
distribute-lft-in56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
metadata-eval56.5%
metadata-eval56.5%
distribute-rgt-in56.5%
+-commutative56.5%
sub-neg56.5%
distribute-rgt-in56.5%
sub-neg56.5%
distribute-rgt-in56.5%
metadata-eval56.5%
distribute-lft-neg-in56.5%
associate-+r+56.6%
Simplified56.6%
Taylor expanded in z around 0 52.9%
*-commutative52.9%
Simplified52.9%
if -5.79999999999999986e-134 < z < 0.650000000000000022Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
if 0.650000000000000022 < 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 y around 0 57.3%
*-lft-identity57.3%
*-commutative57.3%
+-commutative57.3%
*-commutative57.3%
fma-define57.2%
associate-*r*57.2%
fma-define57.3%
distribute-lft-in57.3%
neg-mul-157.3%
distribute-lft-neg-in57.3%
metadata-eval57.3%
metadata-eval57.3%
distribute-rgt-in57.3%
+-commutative57.3%
sub-neg57.3%
distribute-rgt-in57.3%
sub-neg57.3%
distribute-rgt-in57.3%
metadata-eval57.3%
distribute-lft-neg-in57.3%
associate-+r+57.3%
Simplified57.3%
Taylor expanded in z around inf 55.8%
Final simplification57.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -3.2e+157)
t_0
(if (<= z -0.108)
(* -6.0 (* z y))
(if (<= z -3.4e-132) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -3.2e+157) {
tmp = t_0;
} else if (z <= -0.108) {
tmp = -6.0 * (z * y);
} else if (z <= -3.4e-132) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
if (z <= (-3.2d+157)) then
tmp = t_0
else if (z <= (-0.108d0)) then
tmp = (-6.0d0) * (z * y)
else if (z <= (-3.4d-132)) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -3.2e+157) {
tmp = t_0;
} else if (z <= -0.108) {
tmp = -6.0 * (z * y);
} else if (z <= -3.4e-132) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -3.2e+157: tmp = t_0 elif z <= -0.108: tmp = -6.0 * (z * y) elif z <= -3.4e-132: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -3.2e+157) tmp = t_0; elseif (z <= -0.108) tmp = Float64(-6.0 * Float64(z * y)); elseif (z <= -3.4e-132) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -3.2e+157) tmp = t_0; elseif (z <= -0.108) tmp = -6.0 * (z * y); elseif (z <= -3.4e-132) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+157], t$95$0, If[LessEqual[z, -0.108], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.4e-132], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -0.108:\\
\;\;\;\;-6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-132}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.1999999999999999e157 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 58.3%
Taylor expanded in z around inf 57.3%
if -3.1999999999999999e157 < z < -0.107999999999999999Initial program 99.6%
+-commutative99.6%
associate-*l*99.4%
fma-define99.5%
sub-neg99.5%
distribute-rgt-in99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-out99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.2%
Taylor expanded in z around inf 65.2%
if -0.107999999999999999 < z < -3.39999999999999983e-132Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
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 56.5%
*-lft-identity56.5%
*-commutative56.5%
+-commutative56.5%
*-commutative56.5%
fma-define56.5%
associate-*r*56.5%
fma-define56.5%
distribute-lft-in56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
metadata-eval56.5%
metadata-eval56.5%
distribute-rgt-in56.5%
+-commutative56.5%
sub-neg56.5%
distribute-rgt-in56.5%
sub-neg56.5%
distribute-rgt-in56.5%
metadata-eval56.5%
distribute-lft-neg-in56.5%
associate-+r+56.6%
Simplified56.6%
Taylor expanded in z around 0 52.9%
*-commutative52.9%
Simplified52.9%
if -3.39999999999999983e-132 < z < 0.650000000000000022Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
Final simplification57.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* z (- y x)) -6.0)))
(if (<= z -390000.0)
t_0
(if (<= z -8.6e-132)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 0.65) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = (z * (y - x)) * -6.0;
double tmp;
if (z <= -390000.0) {
tmp = t_0;
} else if (z <= -8.6e-132) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z * (y - x)) * (-6.0d0)
if (z <= (-390000.0d0)) then
tmp = t_0
else if (z <= (-8.6d-132)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (y - x)) * -6.0;
double tmp;
if (z <= -390000.0) {
tmp = t_0;
} else if (z <= -8.6e-132) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z * (y - x)) * -6.0 tmp = 0 if z <= -390000.0: tmp = t_0 elif z <= -8.6e-132: tmp = x * (-3.0 + (z * 6.0)) elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(y - x)) * -6.0) tmp = 0.0 if (z <= -390000.0) tmp = t_0; elseif (z <= -8.6e-132) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (y - x)) * -6.0; tmp = 0.0; if (z <= -390000.0) tmp = t_0; elseif (z <= -8.6e-132) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * -6.0), $MachinePrecision]}, If[LessEqual[z, -390000.0], t$95$0, If[LessEqual[z, -8.6e-132], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z \cdot \left(y - x\right)\right) \cdot -6\\
\mathbf{if}\;z \leq -390000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-132}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.9e5 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.0%
Taylor expanded in z around inf 98.0%
if -3.9e5 < z < -8.5999999999999994e-132Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
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 56.5%
*-lft-identity56.5%
*-commutative56.5%
+-commutative56.5%
*-commutative56.5%
fma-define56.5%
associate-*r*56.5%
fma-define56.5%
distribute-lft-in56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
metadata-eval56.5%
metadata-eval56.5%
distribute-rgt-in56.5%
+-commutative56.5%
sub-neg56.5%
distribute-rgt-in56.5%
sub-neg56.5%
distribute-rgt-in56.5%
metadata-eval56.5%
distribute-lft-neg-in56.5%
associate-+r+56.6%
Simplified56.6%
if -8.5999999999999994e-132 < z < 0.650000000000000022Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
Final simplification76.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* z (- y x)) -6.0)))
(if (<= z -1.1e-7)
t_0
(if (<= z -7.5e-136) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = (z * (y - x)) * -6.0;
double tmp;
if (z <= -1.1e-7) {
tmp = t_0;
} else if (z <= -7.5e-136) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z * (y - x)) * (-6.0d0)
if (z <= (-1.1d-7)) then
tmp = t_0
else if (z <= (-7.5d-136)) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (y - x)) * -6.0;
double tmp;
if (z <= -1.1e-7) {
tmp = t_0;
} else if (z <= -7.5e-136) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z * (y - x)) * -6.0 tmp = 0 if z <= -1.1e-7: tmp = t_0 elif z <= -7.5e-136: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(y - x)) * -6.0) tmp = 0.0 if (z <= -1.1e-7) tmp = t_0; elseif (z <= -7.5e-136) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (y - x)) * -6.0; tmp = 0.0; if (z <= -1.1e-7) tmp = t_0; elseif (z <= -7.5e-136) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * -6.0), $MachinePrecision]}, If[LessEqual[z, -1.1e-7], t$95$0, If[LessEqual[z, -7.5e-136], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(z \cdot \left(y - x\right)\right) \cdot -6\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-136}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.1000000000000001e-7 or 0.650000000000000022 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 95.1%
Taylor expanded in z around inf 95.2%
if -1.1000000000000001e-7 < z < -7.5000000000000003e-136Initial program 99.3%
+-commutative99.3%
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 0 60.3%
*-lft-identity60.3%
*-commutative60.3%
+-commutative60.3%
*-commutative60.3%
fma-define60.3%
associate-*r*60.3%
fma-define60.3%
distribute-lft-in60.3%
neg-mul-160.3%
distribute-lft-neg-in60.3%
metadata-eval60.3%
metadata-eval60.3%
distribute-rgt-in60.3%
+-commutative60.3%
sub-neg60.3%
distribute-rgt-in60.3%
sub-neg60.3%
distribute-rgt-in60.3%
metadata-eval60.3%
distribute-lft-neg-in60.3%
associate-+r+60.4%
Simplified60.4%
Taylor expanded in z around 0 58.3%
*-commutative58.3%
Simplified58.3%
if -7.5000000000000003e-136 < z < 0.650000000000000022Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
Final simplification76.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z y))))
(if (<= z -0.88)
t_0
(if (<= z -5.3e-132) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.88) {
tmp = t_0;
} else if (z <= -5.3e-132) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (z * y)
if (z <= (-0.88d0)) then
tmp = t_0
else if (z <= (-5.3d-132)) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.88) {
tmp = t_0;
} else if (z <= -5.3e-132) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * y) tmp = 0 if z <= -0.88: tmp = t_0 elif z <= -5.3e-132: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * y)) tmp = 0.0 if (z <= -0.88) tmp = t_0; elseif (z <= -5.3e-132) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * y); tmp = 0.0; if (z <= -0.88) tmp = t_0; elseif (z <= -5.3e-132) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.88], t$95$0, If[LessEqual[z, -5.3e-132], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -0.88:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.3 \cdot 10^{-132}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.880000000000000004 or 0.650000000000000022 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.6%
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 y around inf 52.8%
Taylor expanded in z around inf 51.9%
if -0.880000000000000004 < z < -5.3000000000000003e-132Initial program 99.2%
+-commutative99.2%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
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 56.5%
*-lft-identity56.5%
*-commutative56.5%
+-commutative56.5%
*-commutative56.5%
fma-define56.5%
associate-*r*56.5%
fma-define56.5%
distribute-lft-in56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
metadata-eval56.5%
metadata-eval56.5%
distribute-rgt-in56.5%
+-commutative56.5%
sub-neg56.5%
distribute-rgt-in56.5%
sub-neg56.5%
distribute-rgt-in56.5%
metadata-eval56.5%
distribute-lft-neg-in56.5%
associate-+r+56.6%
Simplified56.6%
Taylor expanded in z around 0 52.9%
*-commutative52.9%
Simplified52.9%
if -5.3000000000000003e-132 < z < 0.650000000000000022Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 59.4%
Taylor expanded in z around 0 58.2%
Final simplification54.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.55))) (* (* z (- y x)) -6.0) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.55)) {
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.6d0)) .or. (.not. (z <= 0.55d0))) 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.6) || !(z <= 0.55)) {
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.6) or not (z <= 0.55): 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.6) || !(z <= 0.55)) tmp = Float64(Float64(z * 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.6) || ~((z <= 0.55))) 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.6], N[Not[LessEqual[z, 0.55]], $MachinePrecision]], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * -6.0), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.55\right):\\
\;\;\;\;\left(z \cdot \left(y - x\right)\right) \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.55000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.0%
Taylor expanded in z around inf 98.0%
if -0.599999999999999978 < z < 0.55000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.7%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.2e-23) (not (<= y 1.65e-83))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2e-23) || !(y <= 1.65e-83)) {
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 <= (-3.2d-23)) .or. (.not. (y <= 1.65d-83))) 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 <= -3.2e-23) || !(y <= 1.65e-83)) {
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 <= -3.2e-23) or not (y <= 1.65e-83): 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 <= -3.2e-23) || !(y <= 1.65e-83)) 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 <= -3.2e-23) || ~((y <= 1.65e-83))) 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, -3.2e-23], N[Not[LessEqual[y, 1.65e-83]], $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 -3.2 \cdot 10^{-23} \lor \neg \left(y \leq 1.65 \cdot 10^{-83}\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 < -3.19999999999999976e-23 or 1.65e-83 < y 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 inf 77.3%
if -3.19999999999999976e-23 < y < 1.65e-83Initial 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 0 80.0%
*-lft-identity80.0%
*-commutative80.0%
+-commutative80.0%
*-commutative80.0%
fma-define80.0%
associate-*r*80.0%
fma-define80.0%
distribute-lft-in80.0%
neg-mul-180.0%
distribute-lft-neg-in80.0%
metadata-eval80.0%
metadata-eval80.0%
distribute-rgt-in80.0%
+-commutative80.0%
sub-neg80.0%
distribute-rgt-in80.0%
sub-neg80.0%
distribute-rgt-in80.0%
metadata-eval80.0%
distribute-lft-neg-in80.0%
associate-+r+80.0%
Simplified80.0%
Final simplification78.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* z (* (- y x) -6.0))) (if (<= z 0.5) (+ 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 + (z * ((y - x) * -6.0));
} else if (z <= 0.5) {
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 + (z * ((y - x) * (-6.0d0)))
else if (z <= 0.5d0) 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 + (z * ((y - x) * -6.0));
} else if (z <= 0.5) {
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 + (z * ((y - x) * -6.0)) elif z <= 0.5: 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(z * Float64(Float64(y - x) * -6.0))); elseif (z <= 0.5) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(Float64(z * 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 + (z * ((y - x) * -6.0)); elseif (z <= 0.5) 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[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(y - x\right)\right) \cdot -6\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 99.0%
Taylor expanded in y around 0 97.5%
*-commutative97.5%
associate-*l*97.6%
*-commutative97.6%
associate-*r*97.5%
associate-*r*97.5%
*-commutative97.5%
associate-*r*97.5%
*-commutative97.5%
metadata-eval97.5%
distribute-lft-neg-in97.5%
distribute-lft-neg-in97.5%
distribute-rgt-neg-out97.5%
*-commutative97.5%
associate-*r*97.5%
distribute-rgt-out99.2%
distribute-rgt-in99.2%
sub-neg99.2%
Simplified99.2%
if -0.660000000000000031 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.7%
if 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 96.8%
Taylor expanded in z around inf 96.8%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (+ x (+ (* (* z (- y x)) -6.0) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + (((z * (y - x)) * -6.0) + ((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 + (((z * (y - x)) * (-6.0d0)) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + (((z * (y - x)) * -6.0) + ((y - x) * 4.0));
}
def code(x, y, z): return x + (((z * (y - x)) * -6.0) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(z * Float64(y - x)) * -6.0) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + (((z * (y - x)) * -6.0) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] * -6.0), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(z \cdot \left(y - x\right)\right) \cdot -6 + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e-23) (not (<= y 4.1e-83))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e-23) || !(y <= 4.1e-83)) {
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 ((y <= (-2.3d-23)) .or. (.not. (y <= 4.1d-83))) 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 ((y <= -2.3e-23) || !(y <= 4.1e-83)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.3e-23) or not (y <= 4.1e-83): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.3e-23) || !(y <= 4.1e-83)) 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 ((y <= -2.3e-23) || ~((y <= 4.1e-83))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.3e-23], N[Not[LessEqual[y, 4.1e-83]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-23} \lor \neg \left(y \leq 4.1 \cdot 10^{-83}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -2.3000000000000001e-23 or 4.1e-83 < y 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 inf 77.3%
Taylor expanded in z around 0 42.9%
if -2.3000000000000001e-23 < y < 4.1e-83Initial 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 0 80.0%
*-lft-identity80.0%
*-commutative80.0%
+-commutative80.0%
*-commutative80.0%
fma-define80.0%
associate-*r*80.0%
fma-define80.0%
distribute-lft-in80.0%
neg-mul-180.0%
distribute-lft-neg-in80.0%
metadata-eval80.0%
metadata-eval80.0%
distribute-rgt-in80.0%
+-commutative80.0%
sub-neg80.0%
distribute-rgt-in80.0%
sub-neg80.0%
distribute-rgt-in80.0%
metadata-eval80.0%
distribute-lft-neg-in80.0%
associate-+r+80.0%
Simplified80.0%
Taylor expanded in z around 0 41.6%
*-commutative41.6%
Simplified41.6%
Final simplification42.4%
(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%
+-commutative99.6%
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 0 48.7%
*-lft-identity48.7%
*-commutative48.7%
+-commutative48.7%
*-commutative48.7%
fma-define48.7%
associate-*r*48.7%
fma-define48.7%
distribute-lft-in48.7%
neg-mul-148.7%
distribute-lft-neg-in48.7%
metadata-eval48.7%
metadata-eval48.7%
distribute-rgt-in48.7%
+-commutative48.7%
sub-neg48.7%
distribute-rgt-in48.7%
sub-neg48.7%
distribute-rgt-in48.7%
metadata-eval48.7%
distribute-lft-neg-in48.7%
associate-+r+48.7%
Simplified48.7%
Taylor expanded in z around 0 25.2%
*-commutative25.2%
Simplified25.2%
(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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 47.2%
Taylor expanded in z around 0 2.8%
herbie shell --seed 2024172
(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))))