
(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 -2.2e-6)
t_0
(if (<= z 9.8e-91)
(* x -3.0)
(if (<= z 225000000.0)
(* y 4.0)
(if (<= z 1.55e+116) (* z (* y -6.0)) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -2.2e-6) {
tmp = t_0;
} else if (z <= 9.8e-91) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
tmp = y * 4.0;
} else if (z <= 1.55e+116) {
tmp = z * (y * -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 <= (-2.2d-6)) then
tmp = t_0
else if (z <= 9.8d-91) then
tmp = x * (-3.0d0)
else if (z <= 225000000.0d0) then
tmp = y * 4.0d0
else if (z <= 1.55d+116) then
tmp = z * (y * (-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 <= -2.2e-6) {
tmp = t_0;
} else if (z <= 9.8e-91) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
tmp = y * 4.0;
} else if (z <= 1.55e+116) {
tmp = z * (y * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -2.2e-6: tmp = t_0 elif z <= 9.8e-91: tmp = x * -3.0 elif z <= 225000000.0: tmp = y * 4.0 elif z <= 1.55e+116: tmp = z * (y * -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 <= -2.2e-6) tmp = t_0; elseif (z <= 9.8e-91) tmp = Float64(x * -3.0); elseif (z <= 225000000.0) tmp = Float64(y * 4.0); elseif (z <= 1.55e+116) tmp = Float64(z * Float64(y * -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 <= -2.2e-6) tmp = t_0; elseif (z <= 9.8e-91) tmp = x * -3.0; elseif (z <= 225000000.0) tmp = y * 4.0; elseif (z <= 1.55e+116) tmp = z * (y * -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, -2.2e-6], t$95$0, If[LessEqual[z, 9.8e-91], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 225000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.55e+116], N[(z * N[(y * -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 -2.2 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-91}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 225000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+116}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.2000000000000001e-6 or 1.54999999999999998e116 < 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 58.5%
*-lft-identity58.5%
*-commutative58.5%
+-commutative58.5%
*-commutative58.5%
fma-define58.4%
associate-*r*58.4%
neg-mul-158.4%
fma-define58.5%
distribute-neg-in58.5%
distribute-lft-neg-in58.5%
metadata-eval58.5%
metadata-eval58.5%
distribute-rgt-in58.5%
+-commutative58.5%
sub-neg58.5%
distribute-rgt-in58.4%
sub-neg58.4%
distribute-rgt-in58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
associate-+r+58.4%
Simplified58.4%
Taylor expanded in z around inf 57.6%
associate-*r*57.6%
*-commutative57.6%
associate-*r*57.7%
Simplified57.7%
if -2.2000000000000001e-6 < z < 9.7999999999999996e-91Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 61.4%
*-lft-identity61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
fma-define61.4%
associate-*r*61.4%
neg-mul-161.4%
fma-define61.4%
distribute-neg-in61.4%
distribute-lft-neg-in61.4%
metadata-eval61.4%
metadata-eval61.4%
distribute-rgt-in61.4%
+-commutative61.4%
sub-neg61.4%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if 9.7999999999999996e-91 < z < 2.25e8Initial program 99.2%
+-commutative99.2%
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 65.3%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 2.25e8 < z < 1.54999999999999998e116Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 63.2%
Taylor expanded in z around inf 61.4%
*-commutative61.4%
associate-*r*61.4%
Simplified61.4%
Taylor expanded in y around 0 61.4%
associate-*r*61.4%
*-commutative61.4%
Simplified61.4%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -2.2e-6)
t_0
(if (<= z 3.3e-91)
(* x -3.0)
(if (<= z 225000000.0)
(* y 4.0)
(if (<= z 1.2e+116) (* -6.0 (* y z)) t_0))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -2.2e-6) {
tmp = t_0;
} else if (z <= 3.3e-91) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
tmp = y * 4.0;
} else if (z <= 1.2e+116) {
tmp = -6.0 * (y * z);
} 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 <= (-2.2d-6)) then
tmp = t_0
else if (z <= 3.3d-91) then
tmp = x * (-3.0d0)
else if (z <= 225000000.0d0) then
tmp = y * 4.0d0
else if (z <= 1.2d+116) then
tmp = (-6.0d0) * (y * z)
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 <= -2.2e-6) {
tmp = t_0;
} else if (z <= 3.3e-91) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
tmp = y * 4.0;
} else if (z <= 1.2e+116) {
tmp = -6.0 * (y * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -2.2e-6: tmp = t_0 elif z <= 3.3e-91: tmp = x * -3.0 elif z <= 225000000.0: tmp = y * 4.0 elif z <= 1.2e+116: tmp = -6.0 * (y * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -2.2e-6) tmp = t_0; elseif (z <= 3.3e-91) tmp = Float64(x * -3.0); elseif (z <= 225000000.0) tmp = Float64(y * 4.0); elseif (z <= 1.2e+116) tmp = Float64(-6.0 * Float64(y * z)); 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 <= -2.2e-6) tmp = t_0; elseif (z <= 3.3e-91) tmp = x * -3.0; elseif (z <= 225000000.0) tmp = y * 4.0; elseif (z <= 1.2e+116) tmp = -6.0 * (y * z); 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, -2.2e-6], t$95$0, If[LessEqual[z, 3.3e-91], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 225000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e+116], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-91}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 225000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+116}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.2000000000000001e-6 or 1.2e116 < 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 58.5%
*-lft-identity58.5%
*-commutative58.5%
+-commutative58.5%
*-commutative58.5%
fma-define58.4%
associate-*r*58.4%
neg-mul-158.4%
fma-define58.5%
distribute-neg-in58.5%
distribute-lft-neg-in58.5%
metadata-eval58.5%
metadata-eval58.5%
distribute-rgt-in58.5%
+-commutative58.5%
sub-neg58.5%
distribute-rgt-in58.4%
sub-neg58.4%
distribute-rgt-in58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
associate-+r+58.4%
Simplified58.4%
Taylor expanded in z around inf 57.6%
associate-*r*57.6%
*-commutative57.6%
associate-*r*57.7%
Simplified57.7%
if -2.2000000000000001e-6 < z < 3.30000000000000011e-91Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 61.4%
*-lft-identity61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
fma-define61.4%
associate-*r*61.4%
neg-mul-161.4%
fma-define61.4%
distribute-neg-in61.4%
distribute-lft-neg-in61.4%
metadata-eval61.4%
metadata-eval61.4%
distribute-rgt-in61.4%
+-commutative61.4%
sub-neg61.4%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if 3.30000000000000011e-91 < z < 2.25e8Initial program 99.2%
+-commutative99.2%
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 65.3%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 2.25e8 < z < 1.2e116Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 63.2%
Taylor expanded in z around inf 61.4%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -2.2e-6)
t_0
(if (<= z 1.1e-90)
(* x -3.0)
(if (<= z 225000000.0)
(* y 4.0)
(if (<= z 3.8e+117) (* -6.0 (* y z)) t_0))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -2.2e-6) {
tmp = t_0;
} else if (z <= 1.1e-90) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
tmp = y * 4.0;
} else if (z <= 3.8e+117) {
tmp = -6.0 * (y * z);
} 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 <= (-2.2d-6)) then
tmp = t_0
else if (z <= 1.1d-90) then
tmp = x * (-3.0d0)
else if (z <= 225000000.0d0) then
tmp = y * 4.0d0
else if (z <= 3.8d+117) then
tmp = (-6.0d0) * (y * z)
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 <= -2.2e-6) {
tmp = t_0;
} else if (z <= 1.1e-90) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
tmp = y * 4.0;
} else if (z <= 3.8e+117) {
tmp = -6.0 * (y * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -2.2e-6: tmp = t_0 elif z <= 1.1e-90: tmp = x * -3.0 elif z <= 225000000.0: tmp = y * 4.0 elif z <= 3.8e+117: tmp = -6.0 * (y * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -2.2e-6) tmp = t_0; elseif (z <= 1.1e-90) tmp = Float64(x * -3.0); elseif (z <= 225000000.0) tmp = Float64(y * 4.0); elseif (z <= 3.8e+117) tmp = Float64(-6.0 * Float64(y * z)); 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 <= -2.2e-6) tmp = t_0; elseif (z <= 1.1e-90) tmp = x * -3.0; elseif (z <= 225000000.0) tmp = y * 4.0; elseif (z <= 3.8e+117) tmp = -6.0 * (y * z); 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, -2.2e-6], t$95$0, If[LessEqual[z, 1.1e-90], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 225000000.0], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.8e+117], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-90}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 225000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+117}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.2000000000000001e-6 or 3.8000000000000002e117 < 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 58.5%
*-lft-identity58.5%
*-commutative58.5%
+-commutative58.5%
*-commutative58.5%
fma-define58.4%
associate-*r*58.4%
neg-mul-158.4%
fma-define58.5%
distribute-neg-in58.5%
distribute-lft-neg-in58.5%
metadata-eval58.5%
metadata-eval58.5%
distribute-rgt-in58.5%
+-commutative58.5%
sub-neg58.5%
distribute-rgt-in58.4%
sub-neg58.4%
distribute-rgt-in58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
associate-+r+58.4%
Simplified58.4%
Taylor expanded in z around inf 57.6%
if -2.2000000000000001e-6 < z < 1.09999999999999993e-90Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 61.4%
*-lft-identity61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
fma-define61.4%
associate-*r*61.4%
neg-mul-161.4%
fma-define61.4%
distribute-neg-in61.4%
distribute-lft-neg-in61.4%
metadata-eval61.4%
metadata-eval61.4%
distribute-rgt-in61.4%
+-commutative61.4%
sub-neg61.4%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if 1.09999999999999993e-90 < z < 2.25e8Initial program 99.2%
+-commutative99.2%
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 65.3%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 2.25e8 < z < 3.8000000000000002e117Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 63.2%
Taylor expanded in z around inf 61.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- y x) (* z -6.0))))
(if (<= z -4.3e+15)
t_0
(if (<= z 7e-91)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 240000.0) (* y (+ 4.0 (* z -6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z * -6.0);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 7e-91) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 240000.0) {
tmp = y * (4.0 + (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 = (y - x) * (z * (-6.0d0))
if (z <= (-4.3d+15)) then
tmp = t_0
else if (z <= 7d-91) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 240000.0d0) then
tmp = y * (4.0d0 + (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 = (y - x) * (z * -6.0);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 7e-91) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 240000.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z * -6.0) tmp = 0 if z <= -4.3e+15: tmp = t_0 elif z <= 7e-91: tmp = x * (-3.0 + (z * 6.0)) elif z <= 240000.0: tmp = y * (4.0 + (z * -6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z * -6.0)) tmp = 0.0 if (z <= -4.3e+15) tmp = t_0; elseif (z <= 7e-91) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 240000.0) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - x) * (z * -6.0); tmp = 0.0; if (z <= -4.3e+15) tmp = t_0; elseif (z <= 7e-91) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 240000.0) tmp = y * (4.0 + (z * -6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+15], t$95$0, If[LessEqual[z, 7e-91], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 240000.0], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-91}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 240000:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.3e15 or 2.4e5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.1%
Taylor expanded in z around inf 99.1%
associate-*r*99.2%
Simplified99.2%
if -4.3e15 < z < 6.9999999999999997e-91Initial program 99.4%
+-commutative99.4%
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 61.3%
*-lft-identity61.3%
*-commutative61.3%
+-commutative61.3%
*-commutative61.3%
fma-define61.3%
associate-*r*61.3%
neg-mul-161.3%
fma-define61.3%
distribute-neg-in61.3%
distribute-lft-neg-in61.3%
metadata-eval61.3%
metadata-eval61.3%
distribute-rgt-in61.3%
+-commutative61.3%
sub-neg61.3%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
if 6.9999999999999997e-91 < z < 2.4e5Initial program 99.3%
+-commutative99.3%
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 70.3%
Final simplification80.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -4.3e+15)
t_0
(if (<= z 4e-91)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 1800.0) (* y (+ 4.0 (* z -6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 4e-91) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1800.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-4.3d+15)) then
tmp = t_0
else if (z <= 4d-91) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 1800.0d0) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 4e-91) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1800.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -4.3e+15: tmp = t_0 elif z <= 4e-91: tmp = x * (-3.0 + (z * 6.0)) elif z <= 1800.0: tmp = y * (4.0 + (z * -6.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 <= -4.3e+15) tmp = t_0; elseif (z <= 4e-91) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 1800.0) tmp = Float64(y * Float64(4.0 + Float64(z * -6.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 <= -4.3e+15) tmp = t_0; elseif (z <= 4e-91) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 1800.0) tmp = y * (4.0 + (z * -6.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, -4.3e+15], t$95$0, If[LessEqual[z, 4e-91], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1800.0], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $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 -4.3 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-91}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 1800:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.3e15 or 1800 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.1%
Taylor expanded in z around inf 99.1%
if -4.3e15 < z < 4.00000000000000009e-91Initial program 99.4%
+-commutative99.4%
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 61.3%
*-lft-identity61.3%
*-commutative61.3%
+-commutative61.3%
*-commutative61.3%
fma-define61.3%
associate-*r*61.3%
neg-mul-161.3%
fma-define61.3%
distribute-neg-in61.3%
distribute-lft-neg-in61.3%
metadata-eval61.3%
metadata-eval61.3%
distribute-rgt-in61.3%
+-commutative61.3%
sub-neg61.3%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
if 4.00000000000000009e-91 < z < 1800Initial program 99.3%
+-commutative99.3%
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 70.3%
Final simplification80.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -4.3e+15)
t_0
(if (<= z 3e-91)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 0.62) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 3e-91) {
tmp = x * (-3.0 + (z * 6.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 = (-6.0d0) * ((y - x) * z)
if (z <= (-4.3d+15)) then
tmp = t_0
else if (z <= 3d-91) then
tmp = x * ((-3.0d0) + (z * 6.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 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 3e-91) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 0.62) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -4.3e+15: tmp = t_0 elif z <= 3e-91: tmp = x * (-3.0 + (z * 6.0)) elif z <= 0.62: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -4.3e+15) tmp = t_0; elseif (z <= 3e-91) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.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 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -4.3e+15) tmp = t_0; elseif (z <= 3e-91) tmp = x * (-3.0 + (z * 6.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[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+15], t$95$0, If[LessEqual[z, 3e-91], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.62], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-91}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.3e15 or 0.619999999999999996 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 99.1%
Taylor expanded in z around inf 99.1%
if -4.3e15 < z < 3.0000000000000002e-91Initial program 99.4%
+-commutative99.4%
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 61.3%
*-lft-identity61.3%
*-commutative61.3%
+-commutative61.3%
*-commutative61.3%
fma-define61.3%
associate-*r*61.3%
neg-mul-161.3%
fma-define61.3%
distribute-neg-in61.3%
distribute-lft-neg-in61.3%
metadata-eval61.3%
metadata-eval61.3%
distribute-rgt-in61.3%
+-commutative61.3%
sub-neg61.3%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
if 3.0000000000000002e-91 < z < 0.619999999999999996Initial program 99.3%
+-commutative99.3%
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 70.3%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -2.1e-6)
t_0
(if (<= z 1.15e-90) (* x -3.0) (if (<= z 0.56) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -2.1e-6) {
tmp = t_0;
} else if (z <= 1.15e-90) {
tmp = x * -3.0;
} else if (z <= 0.56) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
if (z <= (-2.1d-6)) then
tmp = t_0
else if (z <= 1.15d-90) then
tmp = x * (-3.0d0)
else if (z <= 0.56d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -2.1e-6) {
tmp = t_0;
} else if (z <= 1.15e-90) {
tmp = x * -3.0;
} else if (z <= 0.56) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -2.1e-6: tmp = t_0 elif z <= 1.15e-90: tmp = x * -3.0 elif z <= 0.56: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -2.1e-6) tmp = t_0; elseif (z <= 1.15e-90) tmp = Float64(x * -3.0); elseif (z <= 0.56) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -2.1e-6) tmp = t_0; elseif (z <= 1.15e-90) tmp = x * -3.0; elseif (z <= 0.56) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-6], t$95$0, If[LessEqual[z, 1.15e-90], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-90}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.0999999999999998e-6 or 0.56000000000000005 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.2%
Taylor expanded in z around inf 97.1%
if -2.0999999999999998e-6 < z < 1.1499999999999999e-90Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 61.4%
*-lft-identity61.4%
*-commutative61.4%
+-commutative61.4%
*-commutative61.4%
fma-define61.4%
associate-*r*61.4%
neg-mul-161.4%
fma-define61.4%
distribute-neg-in61.4%
distribute-lft-neg-in61.4%
metadata-eval61.4%
metadata-eval61.4%
distribute-rgt-in61.4%
+-commutative61.4%
sub-neg61.4%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
Taylor expanded in z around 0 60.7%
*-commutative60.7%
Simplified60.7%
if 1.1499999999999999e-90 < z < 0.56000000000000005Initial program 99.3%
+-commutative99.3%
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 70.3%
Taylor expanded in z around 0 66.6%
*-commutative66.6%
Simplified66.6%
Final simplification80.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -4.3e+15)
t_0
(if (<= z 1.25e-90) (* x -3.0) (if (<= z 225000000.0) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -4.3e+15) {
tmp = t_0;
} else if (z <= 1.25e-90) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
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 <= (-4.3d+15)) then
tmp = t_0
else if (z <= 1.25d-90) then
tmp = x * (-3.0d0)
else if (z <= 225000000.0d0) 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 <= -4.3e+15) {
tmp = t_0;
} else if (z <= 1.25e-90) {
tmp = x * -3.0;
} else if (z <= 225000000.0) {
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 <= -4.3e+15: tmp = t_0 elif z <= 1.25e-90: tmp = x * -3.0 elif z <= 225000000.0: 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 <= -4.3e+15) tmp = t_0; elseif (z <= 1.25e-90) tmp = Float64(x * -3.0); elseif (z <= 225000000.0) 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 <= -4.3e+15) tmp = t_0; elseif (z <= 1.25e-90) tmp = x * -3.0; elseif (z <= 225000000.0) 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, -4.3e+15], t$95$0, If[LessEqual[z, 1.25e-90], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 225000000.0], 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 -4.3 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-90}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 225000000:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.3e15 or 2.25e8 < 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 49.7%
Taylor expanded in z around inf 49.4%
if -4.3e15 < z < 1.25000000000000005e-90Initial program 99.4%
+-commutative99.4%
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 61.3%
*-lft-identity61.3%
*-commutative61.3%
+-commutative61.3%
*-commutative61.3%
fma-define61.3%
associate-*r*61.3%
neg-mul-161.3%
fma-define61.3%
distribute-neg-in61.3%
distribute-lft-neg-in61.3%
metadata-eval61.3%
metadata-eval61.3%
distribute-rgt-in61.3%
+-commutative61.3%
sub-neg61.3%
distribute-rgt-in61.4%
sub-neg61.4%
distribute-rgt-in61.4%
metadata-eval61.4%
distribute-lft-neg-in61.4%
associate-+r+61.4%
Simplified61.4%
Taylor expanded in z around 0 58.4%
*-commutative58.4%
Simplified58.4%
if 1.25000000000000005e-90 < z < 2.25e8Initial program 99.2%
+-commutative99.2%
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 65.3%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.65))) (* (- y x) (* z -6.0)) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.65)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = (y * 4.0) + (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 ((z <= (-0.58d0)) .or. (.not. (z <= 0.65d0))) then
tmp = (y - x) * (z * (-6.0d0))
else
tmp = (y * 4.0d0) + (x * (-3.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 = (y - x) * (z * -6.0);
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.65): tmp = (y - x) * (z * -6.0) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.65)) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.65))) tmp = (y - x) * (z * -6.0); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.65]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.65\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.650000000000000022 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
associate-*r*98.5%
Simplified98.5%
if -0.57999999999999996 < z < 0.650000000000000022Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 97.9%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.52) (not (<= z 0.5))) (* (- y x) (* z -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.52) || !(z <= 0.5)) {
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.52d0)) .or. (.not. (z <= 0.5d0))) 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.52) || !(z <= 0.5)) {
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.52) or not (z <= 0.5): 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.52) || !(z <= 0.5)) 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.52) || ~((z <= 0.5))) 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.52], N[Not[LessEqual[z, 0.5]], $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.52 \lor \neg \left(z \leq 0.5\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.52000000000000002 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
associate-*r*98.5%
Simplified98.5%
if -0.52000000000000002 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.9%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.65) (* z (+ (* y -6.0) (* x 6.0))) (if (<= z 0.55) (+ (* y 4.0) (* x -3.0)) (* (- y x) (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.65d0)) then
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
else if (z <= 0.55d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = (y - x) * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.65: tmp = z * ((y * -6.0) + (x * 6.0)) elif z <= 0.55: tmp = (y * 4.0) + (x * -3.0) else: tmp = (y - x) * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.65) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); elseif (z <= 0.55) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(Float64(y - x) * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.65) tmp = z * ((y * -6.0) + (x * 6.0)); elseif (z <= 0.55) tmp = (y * 4.0) + (x * -3.0); else tmp = (y - x) * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.65], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.55], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.650000000000000022Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 94.3%
Taylor expanded in z around inf 98.5%
if -0.650000000000000022 < z < 0.55000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 97.9%
if 0.55000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.5%
Taylor expanded in z around inf 98.5%
associate-*r*98.5%
Simplified98.5%
Final simplification98.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.2) (not (<= y 3.5e+16))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.2) || !(y <= 3.5e+16)) {
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 <= (-3.2d0)) .or. (.not. (y <= 3.5d+16))) 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 <= -3.2) || !(y <= 3.5e+16)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.2) or not (y <= 3.5e+16): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.2) || !(y <= 3.5e+16)) 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 <= -3.2) || ~((y <= 3.5e+16))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.2], N[Not[LessEqual[y, 3.5e+16]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \lor \neg \left(y \leq 3.5 \cdot 10^{+16}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -3.2000000000000002 or 3.5e16 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 74.6%
Taylor expanded in z around 0 35.0%
*-commutative35.0%
Simplified35.0%
if -3.2000000000000002 < y < 3.5e16Initial 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 77.7%
*-lft-identity77.7%
*-commutative77.7%
+-commutative77.7%
*-commutative77.7%
fma-define77.7%
associate-*r*77.7%
neg-mul-177.7%
fma-define77.7%
distribute-neg-in77.7%
distribute-lft-neg-in77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-rgt-in77.7%
+-commutative77.7%
sub-neg77.7%
distribute-rgt-in77.7%
sub-neg77.7%
distribute-rgt-in77.7%
metadata-eval77.7%
distribute-lft-neg-in77.7%
associate-+r+77.7%
Simplified77.7%
Taylor expanded in z around 0 41.2%
*-commutative41.2%
Simplified41.2%
Final simplification38.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.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 56.8%
*-lft-identity56.8%
*-commutative56.8%
+-commutative56.8%
*-commutative56.8%
fma-define56.8%
associate-*r*56.8%
neg-mul-156.8%
fma-define56.8%
distribute-neg-in56.8%
distribute-lft-neg-in56.8%
metadata-eval56.8%
metadata-eval56.8%
distribute-rgt-in56.8%
+-commutative56.8%
sub-neg56.8%
distribute-rgt-in56.8%
sub-neg56.8%
distribute-rgt-in56.8%
metadata-eval56.8%
distribute-lft-neg-in56.8%
associate-+r+56.8%
Simplified56.8%
Taylor expanded in z around 0 29.2%
*-commutative29.2%
Simplified29.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 52.0%
Taylor expanded in z around 0 2.5%
herbie shell --seed 2024133
(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))))