
(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 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.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 (* x (* z 6.0))))
(if (<= z -105.0)
t_0
(if (<= z -7.5e-195)
(* y 4.0)
(if (<= z 1.25e-302)
(* x -3.0)
(if (<= z 0.65)
(* y 4.0)
(if (<= z 3.3e+46) (* y (* z -6.0)) t_0)))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -105.0) {
tmp = t_0;
} else if (z <= -7.5e-195) {
tmp = y * 4.0;
} else if (z <= 1.25e-302) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else if (z <= 3.3e+46) {
tmp = y * (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 = x * (z * 6.0d0)
if (z <= (-105.0d0)) then
tmp = t_0
else if (z <= (-7.5d-195)) then
tmp = y * 4.0d0
else if (z <= 1.25d-302) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else if (z <= 3.3d+46) then
tmp = y * (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 = x * (z * 6.0);
double tmp;
if (z <= -105.0) {
tmp = t_0;
} else if (z <= -7.5e-195) {
tmp = y * 4.0;
} else if (z <= 1.25e-302) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else if (z <= 3.3e+46) {
tmp = y * (z * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -105.0: tmp = t_0 elif z <= -7.5e-195: tmp = y * 4.0 elif z <= 1.25e-302: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 elif z <= 3.3e+46: tmp = y * (z * -6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -105.0) tmp = t_0; elseif (z <= -7.5e-195) tmp = Float64(y * 4.0); elseif (z <= 1.25e-302) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); elseif (z <= 3.3e+46) tmp = Float64(y * Float64(z * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -105.0) tmp = t_0; elseif (z <= -7.5e-195) tmp = y * 4.0; elseif (z <= 1.25e-302) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; elseif (z <= 3.3e+46) tmp = y * (z * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -105.0], t$95$0, If[LessEqual[z, -7.5e-195], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.25e-302], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.3e+46], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -105:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-195}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+46}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -105 or 3.2999999999999998e46 < z Initial 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 0 62.1%
*-lft-identity62.1%
*-commutative62.1%
+-commutative62.1%
*-commutative62.1%
fma-define62.2%
associate-*r*62.2%
fma-define62.1%
distribute-lft-in62.1%
neg-mul-162.1%
distribute-lft-neg-in62.1%
metadata-eval62.1%
metadata-eval62.1%
distribute-rgt-in62.1%
+-commutative62.1%
sub-neg62.1%
distribute-rgt-in62.1%
sub-neg62.1%
distribute-rgt-in62.2%
metadata-eval62.2%
distribute-lft-neg-in62.2%
associate-+r+62.2%
Simplified62.2%
Taylor expanded in z around inf 61.3%
if -105 < z < -7.5e-195 or 1.25000000000000008e-302 < z < 0.650000000000000022Initial 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 63.4%
Taylor expanded in z around 0 59.7%
*-commutative59.7%
Simplified59.7%
if -7.5e-195 < z < 1.25000000000000008e-302Initial program 99.4%
+-commutative99.4%
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.2%
*-lft-identity80.2%
*-commutative80.2%
+-commutative80.2%
*-commutative80.2%
fma-define80.2%
associate-*r*80.2%
fma-define80.2%
distribute-lft-in80.2%
neg-mul-180.2%
distribute-lft-neg-in80.2%
metadata-eval80.2%
metadata-eval80.2%
distribute-rgt-in80.2%
+-commutative80.2%
sub-neg80.2%
distribute-rgt-in80.2%
sub-neg80.2%
distribute-rgt-in80.2%
metadata-eval80.2%
distribute-lft-neg-in80.2%
associate-+r+80.2%
Simplified80.2%
Taylor expanded in z around 0 80.2%
*-commutative80.2%
Simplified80.2%
if 0.650000000000000022 < z < 3.2999999999999998e46Initial program 99.5%
+-commutative99.5%
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 78.0%
Taylor expanded in z around inf 61.8%
associate-*r*61.9%
*-commutative61.9%
associate-*r*62.1%
Simplified62.1%
Final simplification62.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -105.0)
t_0
(if (<= z -6.6e-195)
(* y 4.0)
(if (<= z 1.12e-302) (* x -3.0) (if (<= z 0.62) (* y 4.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -105.0) {
tmp = t_0;
} else if (z <= -6.6e-195) {
tmp = y * 4.0;
} else if (z <= 1.12e-302) {
tmp = x * -3.0;
} else if (z <= 0.62) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (z * 6.0d0)
if (z <= (-105.0d0)) then
tmp = t_0
else if (z <= (-6.6d-195)) then
tmp = y * 4.0d0
else if (z <= 1.12d-302) then
tmp = x * (-3.0d0)
else if (z <= 0.62d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -105.0) {
tmp = t_0;
} else if (z <= -6.6e-195) {
tmp = y * 4.0;
} else if (z <= 1.12e-302) {
tmp = x * -3.0;
} else if (z <= 0.62) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -105.0: tmp = t_0 elif z <= -6.6e-195: tmp = y * 4.0 elif z <= 1.12e-302: tmp = x * -3.0 elif z <= 0.62: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -105.0) tmp = t_0; elseif (z <= -6.6e-195) tmp = Float64(y * 4.0); elseif (z <= 1.12e-302) tmp = Float64(x * -3.0); elseif (z <= 0.62) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -105.0) tmp = t_0; elseif (z <= -6.6e-195) tmp = y * 4.0; elseif (z <= 1.12e-302) tmp = x * -3.0; elseif (z <= 0.62) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -105.0], t$95$0, If[LessEqual[z, -6.6e-195], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.12e-302], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -105:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-195}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -105 or 0.619999999999999996 < z Initial 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 0 59.6%
*-lft-identity59.6%
*-commutative59.6%
+-commutative59.6%
*-commutative59.6%
fma-define59.6%
associate-*r*59.6%
fma-define59.6%
distribute-lft-in59.6%
neg-mul-159.6%
distribute-lft-neg-in59.6%
metadata-eval59.6%
metadata-eval59.6%
distribute-rgt-in59.5%
+-commutative59.5%
sub-neg59.5%
distribute-rgt-in59.6%
sub-neg59.6%
distribute-rgt-in59.6%
metadata-eval59.6%
distribute-lft-neg-in59.6%
associate-+r+59.6%
Simplified59.6%
Taylor expanded in z around inf 58.4%
if -105 < z < -6.6e-195 or 1.12e-302 < z < 0.619999999999999996Initial 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 63.4%
Taylor expanded in z around 0 59.7%
*-commutative59.7%
Simplified59.7%
if -6.6e-195 < z < 1.12e-302Initial program 99.4%
+-commutative99.4%
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.2%
*-lft-identity80.2%
*-commutative80.2%
+-commutative80.2%
*-commutative80.2%
fma-define80.2%
associate-*r*80.2%
fma-define80.2%
distribute-lft-in80.2%
neg-mul-180.2%
distribute-lft-neg-in80.2%
metadata-eval80.2%
metadata-eval80.2%
distribute-rgt-in80.2%
+-commutative80.2%
sub-neg80.2%
distribute-rgt-in80.2%
sub-neg80.2%
distribute-rgt-in80.2%
metadata-eval80.2%
distribute-lft-neg-in80.2%
associate-+r+80.2%
Simplified80.2%
Taylor expanded in z around 0 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification60.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.66)
t_0
(if (<= z -2.05e-196)
(* y 4.0)
(if (<= z 1.15e-302) (* 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 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= -2.05e-196) {
tmp = y * 4.0;
} else if (z <= 1.15e-302) {
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) * (y * z)
if (z <= (-0.66d0)) then
tmp = t_0
else if (z <= (-2.05d-196)) then
tmp = y * 4.0d0
else if (z <= 1.15d-302) 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 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= -2.05e-196) {
tmp = y * 4.0;
} else if (z <= 1.15e-302) {
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 * (y * z) tmp = 0 if z <= -0.66: tmp = t_0 elif z <= -2.05e-196: tmp = y * 4.0 elif z <= 1.15e-302: 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(y * z)) tmp = 0.0 if (z <= -0.66) tmp = t_0; elseif (z <= -2.05e-196) tmp = Float64(y * 4.0); elseif (z <= 1.15e-302) 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 * (y * z); tmp = 0.0; if (z <= -0.66) tmp = t_0; elseif (z <= -2.05e-196) tmp = y * 4.0; elseif (z <= 1.15e-302) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, -2.05e-196], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.15e-302], 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(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-196}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.650000000000000022 < z Initial 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 48.5%
Taylor expanded in z around inf 45.6%
if -0.660000000000000031 < z < -2.05000000000000011e-196 or 1.15000000000000001e-302 < z < 0.650000000000000022Initial 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 63.0%
Taylor expanded in z around 0 60.1%
*-commutative60.1%
Simplified60.1%
if -2.05000000000000011e-196 < z < 1.15000000000000001e-302Initial program 99.4%
+-commutative99.4%
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.2%
*-lft-identity80.2%
*-commutative80.2%
+-commutative80.2%
*-commutative80.2%
fma-define80.2%
associate-*r*80.2%
fma-define80.2%
distribute-lft-in80.2%
neg-mul-180.2%
distribute-lft-neg-in80.2%
metadata-eval80.2%
metadata-eval80.2%
distribute-rgt-in80.2%
+-commutative80.2%
sub-neg80.2%
distribute-rgt-in80.2%
sub-neg80.2%
distribute-rgt-in80.2%
metadata-eval80.2%
distribute-lft-neg-in80.2%
associate-+r+80.2%
Simplified80.2%
Taylor expanded in z around 0 80.2%
*-commutative80.2%
Simplified80.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.66) (not (<= z 0.58))) (+ x (* (- y x) (* z -6.0))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.66) || !(z <= 0.58)) {
tmp = x + ((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.66d0)) .or. (.not. (z <= 0.58d0))) then
tmp = x + ((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.66) || !(z <= 0.58)) {
tmp = x + ((y - x) * (z * -6.0));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.66) or not (z <= 0.58): tmp = x + ((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.66) || !(z <= 0.58)) tmp = Float64(x + 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.66) || ~((z <= 0.58))) tmp = x + ((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.66], N[Not[LessEqual[z, 0.58]], $MachinePrecision]], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;x + \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.660000000000000031 or 0.57999999999999996 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 96.3%
*-commutative96.3%
*-commutative96.3%
associate-*l*96.4%
*-commutative96.4%
Simplified96.4%
if -0.660000000000000031 < z < 0.57999999999999996Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.1%
Final simplification96.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.65))) (* z (+ (* y -6.0) (* x 6.0))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.65)) {
tmp = z * ((y * -6.0) + (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.65d0))) then
tmp = z * ((y * (-6.0d0)) + (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.65)) {
tmp = z * ((y * -6.0) + (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.65): tmp = z * ((y * -6.0) + (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.65)) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(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.65))) tmp = z * ((y * -6.0) + (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.65]], $MachinePrecision]], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $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.65\right):\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.650000000000000022 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.1%
Taylor expanded in z around inf 96.3%
if -0.57999999999999996 < z < 0.650000000000000022Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.1%
Final simplification96.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* -6.0 (* (- y x) z))) (if (<= z 0.52) (+ x (* (- y x) 4.0)) (* z (+ (* y -6.0) (* x 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (-6.0 * ((y - x) * z));
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y * -6.0) + (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 + ((-6.0d0) * ((y - x) * z))
else if (z <= 0.52d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y * (-6.0d0)) + (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 + (-6.0 * ((y - x) * z));
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + (-6.0 * ((y - x) * z)) elif z <= 0.52: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y * -6.0) + (x * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); elseif (z <= 0.52) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + (-6.0 * ((y - x) * z)); elseif (z <= 0.52) tmp = x + ((y - x) * 4.0); else tmp = z * ((y * -6.0) + (x * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.52], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \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 96.5%
if -0.660000000000000031 < z < 0.52000000000000002Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.1%
if 0.52000000000000002 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.9%
Taylor expanded in z around inf 96.1%
Final simplification96.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.7e+33) (not (<= x 1.6e-19))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.7e+33) || !(x <= 1.6e-19)) {
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 <= (-1.7d+33)) .or. (.not. (x <= 1.6d-19))) 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 <= -1.7e+33) || !(x <= 1.6e-19)) {
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 <= -1.7e+33) or not (x <= 1.6e-19): 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 <= -1.7e+33) || !(x <= 1.6e-19)) 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 <= -1.7e+33) || ~((x <= 1.6e-19))) 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, -1.7e+33], N[Not[LessEqual[x, 1.6e-19]], $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 -1.7 \cdot 10^{+33} \lor \neg \left(x \leq 1.6 \cdot 10^{-19}\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 < -1.7e33 or 1.59999999999999991e-19 < x 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 0 85.9%
*-lft-identity85.9%
*-commutative85.9%
+-commutative85.9%
*-commutative85.9%
fma-define85.9%
associate-*r*85.9%
fma-define85.9%
distribute-lft-in85.9%
neg-mul-185.9%
distribute-lft-neg-in85.9%
metadata-eval85.9%
metadata-eval85.9%
distribute-rgt-in85.9%
+-commutative85.9%
sub-neg85.9%
distribute-rgt-in85.9%
sub-neg85.9%
distribute-rgt-in85.9%
metadata-eval85.9%
distribute-lft-neg-in85.9%
associate-+r+85.9%
Simplified85.9%
if -1.7e33 < x < 1.59999999999999991e-19Initial 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 79.5%
Final simplification82.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -8.5e+30) (not (<= x 3.3e-16))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -8.5e+30) || !(x <= 3.3e-16)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-8.5d+30)) .or. (.not. (x <= 3.3d-16))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -8.5e+30) || !(x <= 3.3e-16)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -8.5e+30) or not (x <= 3.3e-16): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -8.5e+30) || !(x <= 3.3e-16)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -8.5e+30) || ~((x <= 3.3e-16))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -8.5e+30], N[Not[LessEqual[x, 3.3e-16]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+30} \lor \neg \left(x \leq 3.3 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -8.4999999999999995e30 or 3.29999999999999988e-16 < x 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 0 85.9%
*-lft-identity85.9%
*-commutative85.9%
+-commutative85.9%
*-commutative85.9%
fma-define85.9%
associate-*r*85.9%
fma-define85.9%
distribute-lft-in85.9%
neg-mul-185.9%
distribute-lft-neg-in85.9%
metadata-eval85.9%
metadata-eval85.9%
distribute-rgt-in85.9%
+-commutative85.9%
sub-neg85.9%
distribute-rgt-in85.9%
sub-neg85.9%
distribute-rgt-in85.9%
metadata-eval85.9%
distribute-lft-neg-in85.9%
associate-+r+85.9%
Simplified85.9%
if -8.4999999999999995e30 < x < 3.29999999999999988e-16Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 79.3%
Final simplification82.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.75e+76) (not (<= x 2.2e+111))) (* x (* z 6.0)) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.75e+76) || !(x <= 2.2e+111)) {
tmp = x * (z * 6.0);
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.75d+76)) .or. (.not. (x <= 2.2d+111))) then
tmp = x * (z * 6.0d0)
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.75e+76) || !(x <= 2.2e+111)) {
tmp = x * (z * 6.0);
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.75e+76) or not (x <= 2.2e+111): tmp = x * (z * 6.0) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.75e+76) || !(x <= 2.2e+111)) tmp = Float64(x * Float64(z * 6.0)); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.75e+76) || ~((x <= 2.2e+111))) tmp = x * (z * 6.0); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.75e+76], N[Not[LessEqual[x, 2.2e+111]], $MachinePrecision]], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+76} \lor \neg \left(x \leq 2.2 \cdot 10^{+111}\right):\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -1.75e76 or 2.19999999999999999e111 < x 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 0 94.9%
*-lft-identity94.9%
*-commutative94.9%
+-commutative94.9%
*-commutative94.9%
fma-define94.9%
associate-*r*94.9%
fma-define94.9%
distribute-lft-in94.9%
neg-mul-194.9%
distribute-lft-neg-in94.9%
metadata-eval94.9%
metadata-eval94.9%
distribute-rgt-in94.9%
+-commutative94.9%
sub-neg94.9%
distribute-rgt-in94.9%
sub-neg94.9%
distribute-rgt-in94.9%
metadata-eval94.9%
distribute-lft-neg-in94.9%
associate-+r+94.9%
Simplified94.9%
Taylor expanded in z around inf 57.9%
if -1.75e76 < x < 2.19999999999999999e111Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 71.1%
Final simplification66.7%
(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.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 (<= x -5.5e+33) (not (<= x 1.55e-22))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.5e+33) || !(x <= 1.55e-22)) {
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 <= (-5.5d+33)) .or. (.not. (x <= 1.55d-22))) 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 <= -5.5e+33) || !(x <= 1.55e-22)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.5e+33) or not (x <= 1.55e-22): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.5e+33) || !(x <= 1.55e-22)) 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 <= -5.5e+33) || ~((x <= 1.55e-22))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.5e+33], N[Not[LessEqual[x, 1.55e-22]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+33} \lor \neg \left(x \leq 1.55 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -5.5000000000000006e33 or 1.55000000000000006e-22 < x 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 0 85.1%
*-lft-identity85.1%
*-commutative85.1%
+-commutative85.1%
*-commutative85.1%
fma-define85.1%
associate-*r*85.1%
fma-define85.1%
distribute-lft-in85.1%
neg-mul-185.1%
distribute-lft-neg-in85.1%
metadata-eval85.1%
metadata-eval85.1%
distribute-rgt-in85.1%
+-commutative85.1%
sub-neg85.1%
distribute-rgt-in85.1%
sub-neg85.1%
distribute-rgt-in85.1%
metadata-eval85.1%
distribute-lft-neg-in85.1%
associate-+r+85.1%
Simplified85.1%
Taylor expanded in z around 0 37.9%
*-commutative37.9%
Simplified37.9%
if -5.5000000000000006e33 < x < 1.55000000000000006e-22Initial 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 78.8%
Taylor expanded in z around 0 41.6%
*-commutative41.6%
Simplified41.6%
Final simplification39.9%
(FPCore (x y z) :precision binary64 (+ x (* (+ (* x -6.0) (* y 6.0)) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((x * -6.0) + (y * 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 + (((x * (-6.0d0)) + (y * 6.0d0)) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(x * -6.0) + Float64(y * 6.0)) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((x * -6.0) + (y * 6.0)) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(x * -6.0), $MachinePrecision] + N[(y * 6.0), $MachinePrecision]), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(x \cdot -6 + y \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
Final simplification99.6%
(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.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.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.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 52.4%
*-lft-identity52.4%
*-commutative52.4%
+-commutative52.4%
*-commutative52.4%
fma-define52.4%
associate-*r*52.4%
fma-define52.4%
distribute-lft-in52.4%
neg-mul-152.4%
distribute-lft-neg-in52.4%
metadata-eval52.4%
metadata-eval52.4%
distribute-rgt-in52.4%
+-commutative52.4%
sub-neg52.4%
distribute-rgt-in52.4%
sub-neg52.4%
distribute-rgt-in52.4%
metadata-eval52.4%
distribute-lft-neg-in52.4%
associate-+r+52.4%
Simplified52.4%
Taylor expanded in z around 0 22.6%
*-commutative22.6%
Simplified22.6%
(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 y around inf 51.6%
Taylor expanded in x around inf 2.6%
herbie shell --seed 2024185
(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))))