
(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 13 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.2%
+-commutative99.2%
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
(if (<= z -0.0048)
(* z (* x 6.0))
(if (<= z -9.2e-32)
(* x -3.0)
(if (<= z -7.2e-151)
(* y 4.0)
(if (<= z -9e-207)
(* x -3.0)
(if (<= z 2.4e-275)
(* y 4.0)
(if (<= z 800000.0) (* x -3.0) (* x (* z 6.0)))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.0048) {
tmp = z * (x * 6.0);
} else if (z <= -9.2e-32) {
tmp = x * -3.0;
} else if (z <= -7.2e-151) {
tmp = y * 4.0;
} else if (z <= -9e-207) {
tmp = x * -3.0;
} else if (z <= 2.4e-275) {
tmp = y * 4.0;
} else if (z <= 800000.0) {
tmp = x * -3.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 <= (-0.0048d0)) then
tmp = z * (x * 6.0d0)
else if (z <= (-9.2d-32)) then
tmp = x * (-3.0d0)
else if (z <= (-7.2d-151)) then
tmp = y * 4.0d0
else if (z <= (-9d-207)) then
tmp = x * (-3.0d0)
else if (z <= 2.4d-275) then
tmp = y * 4.0d0
else if (z <= 800000.0d0) then
tmp = x * (-3.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 <= -0.0048) {
tmp = z * (x * 6.0);
} else if (z <= -9.2e-32) {
tmp = x * -3.0;
} else if (z <= -7.2e-151) {
tmp = y * 4.0;
} else if (z <= -9e-207) {
tmp = x * -3.0;
} else if (z <= 2.4e-275) {
tmp = y * 4.0;
} else if (z <= 800000.0) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.0048: tmp = z * (x * 6.0) elif z <= -9.2e-32: tmp = x * -3.0 elif z <= -7.2e-151: tmp = y * 4.0 elif z <= -9e-207: tmp = x * -3.0 elif z <= 2.4e-275: tmp = y * 4.0 elif z <= 800000.0: tmp = x * -3.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.0048) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -9.2e-32) tmp = Float64(x * -3.0); elseif (z <= -7.2e-151) tmp = Float64(y * 4.0); elseif (z <= -9e-207) tmp = Float64(x * -3.0); elseif (z <= 2.4e-275) tmp = Float64(y * 4.0); elseif (z <= 800000.0) tmp = Float64(x * -3.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 <= -0.0048) tmp = z * (x * 6.0); elseif (z <= -9.2e-32) tmp = x * -3.0; elseif (z <= -7.2e-151) tmp = y * 4.0; elseif (z <= -9e-207) tmp = x * -3.0; elseif (z <= 2.4e-275) tmp = y * 4.0; elseif (z <= 800000.0) tmp = x * -3.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.0048], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.2e-32], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7.2e-151], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -9e-207], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.4e-275], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 800000.0], N[(x * -3.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0048:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-32}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-151}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-207}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-275}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 800000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.00479999999999999958Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 51.8%
metadata-eval51.8%
cancel-sign-sub-inv51.8%
*-commutative51.8%
cancel-sign-sub-inv51.8%
distribute-lft-neg-in51.8%
*-commutative51.8%
sub-neg51.8%
distribute-lft-in51.8%
metadata-eval51.8%
distribute-rgt-neg-out51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
mul-1-neg51.8%
distribute-lft-in51.8%
metadata-eval51.8%
associate-+r+51.8%
metadata-eval51.8%
associate-*r*51.8%
metadata-eval51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in z around 0 51.8%
Taylor expanded in z around inf 50.1%
*-commutative50.1%
*-commutative50.1%
associate-*r*50.1%
Simplified50.1%
if -0.00479999999999999958 < z < -9.2000000000000002e-32 or -7.20000000000000064e-151 < z < -8.99999999999999984e-207 or 2.39999999999999991e-275 < z < 8e5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 68.1%
metadata-eval68.1%
cancel-sign-sub-inv68.1%
*-commutative68.1%
cancel-sign-sub-inv68.1%
distribute-lft-neg-in68.1%
*-commutative68.1%
sub-neg68.1%
distribute-lft-in68.2%
metadata-eval68.2%
distribute-rgt-neg-out68.2%
distribute-lft-neg-in68.2%
metadata-eval68.2%
mul-1-neg68.2%
distribute-lft-in68.2%
metadata-eval68.2%
associate-+r+68.2%
metadata-eval68.2%
associate-*r*68.2%
metadata-eval68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -9.2000000000000002e-32 < z < -7.20000000000000064e-151 or -8.99999999999999984e-207 < z < 2.39999999999999991e-275Initial program 97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 70.9%
*-commutative70.9%
Simplified70.9%
if 8e5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 51.1%
metadata-eval51.1%
cancel-sign-sub-inv51.1%
*-commutative51.1%
cancel-sign-sub-inv51.1%
distribute-lft-neg-in51.1%
*-commutative51.1%
sub-neg51.1%
distribute-lft-in51.1%
metadata-eval51.1%
distribute-rgt-neg-out51.1%
distribute-lft-neg-in51.1%
metadata-eval51.1%
mul-1-neg51.1%
distribute-lft-in51.1%
metadata-eval51.1%
associate-+r+51.1%
metadata-eval51.1%
associate-*r*51.1%
metadata-eval51.1%
*-commutative51.1%
Simplified51.1%
Taylor expanded in z around inf 49.8%
Final simplification58.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -0.0048)
t_0
(if (<= z -5.5e-31)
(* x -3.0)
(if (<= z -3.6e-152)
(* y 4.0)
(if (<= z -5.8e-210)
(* x -3.0)
(if (<= z 2.15e-275)
(* y 4.0)
(if (<= z 800000.0) (* x -3.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -0.0048) {
tmp = t_0;
} else if (z <= -5.5e-31) {
tmp = x * -3.0;
} else if (z <= -3.6e-152) {
tmp = y * 4.0;
} else if (z <= -5.8e-210) {
tmp = x * -3.0;
} else if (z <= 2.15e-275) {
tmp = y * 4.0;
} else if (z <= 800000.0) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (z * 6.0d0)
if (z <= (-0.0048d0)) then
tmp = t_0
else if (z <= (-5.5d-31)) then
tmp = x * (-3.0d0)
else if (z <= (-3.6d-152)) then
tmp = y * 4.0d0
else if (z <= (-5.8d-210)) then
tmp = x * (-3.0d0)
else if (z <= 2.15d-275) then
tmp = y * 4.0d0
else if (z <= 800000.0d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -0.0048) {
tmp = t_0;
} else if (z <= -5.5e-31) {
tmp = x * -3.0;
} else if (z <= -3.6e-152) {
tmp = y * 4.0;
} else if (z <= -5.8e-210) {
tmp = x * -3.0;
} else if (z <= 2.15e-275) {
tmp = y * 4.0;
} else if (z <= 800000.0) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -0.0048: tmp = t_0 elif z <= -5.5e-31: tmp = x * -3.0 elif z <= -3.6e-152: tmp = y * 4.0 elif z <= -5.8e-210: tmp = x * -3.0 elif z <= 2.15e-275: tmp = y * 4.0 elif z <= 800000.0: tmp = x * -3.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 <= -0.0048) tmp = t_0; elseif (z <= -5.5e-31) tmp = Float64(x * -3.0); elseif (z <= -3.6e-152) tmp = Float64(y * 4.0); elseif (z <= -5.8e-210) tmp = Float64(x * -3.0); elseif (z <= 2.15e-275) tmp = Float64(y * 4.0); elseif (z <= 800000.0) tmp = Float64(x * -3.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 <= -0.0048) tmp = t_0; elseif (z <= -5.5e-31) tmp = x * -3.0; elseif (z <= -3.6e-152) tmp = y * 4.0; elseif (z <= -5.8e-210) tmp = x * -3.0; elseif (z <= 2.15e-275) tmp = y * 4.0; elseif (z <= 800000.0) tmp = x * -3.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, -0.0048], t$95$0, If[LessEqual[z, -5.5e-31], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.6e-152], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.8e-210], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.15e-275], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 800000.0], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -0.0048:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-31}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-210}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-275}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 800000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.00479999999999999958 or 8e5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 51.5%
metadata-eval51.5%
cancel-sign-sub-inv51.5%
*-commutative51.5%
cancel-sign-sub-inv51.5%
distribute-lft-neg-in51.5%
*-commutative51.5%
sub-neg51.5%
distribute-lft-in51.4%
metadata-eval51.4%
distribute-rgt-neg-out51.4%
distribute-lft-neg-in51.4%
metadata-eval51.4%
mul-1-neg51.4%
distribute-lft-in51.4%
metadata-eval51.4%
associate-+r+51.4%
metadata-eval51.4%
associate-*r*51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in z around inf 50.0%
if -0.00479999999999999958 < z < -5.49999999999999958e-31 or -3.6e-152 < z < -5.80000000000000012e-210 or 2.14999999999999988e-275 < z < 8e5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 68.1%
metadata-eval68.1%
cancel-sign-sub-inv68.1%
*-commutative68.1%
cancel-sign-sub-inv68.1%
distribute-lft-neg-in68.1%
*-commutative68.1%
sub-neg68.1%
distribute-lft-in68.2%
metadata-eval68.2%
distribute-rgt-neg-out68.2%
distribute-lft-neg-in68.2%
metadata-eval68.2%
mul-1-neg68.2%
distribute-lft-in68.2%
metadata-eval68.2%
associate-+r+68.2%
metadata-eval68.2%
associate-*r*68.2%
metadata-eval68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -5.49999999999999958e-31 < z < -3.6e-152 or -5.80000000000000012e-210 < z < 2.14999999999999988e-275Initial program 97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 70.9%
*-commutative70.9%
Simplified70.9%
Final simplification58.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -0.0048)
t_0
(if (<= z -3e-31)
(* x -3.0)
(if (<= z -5.8e-152)
(* y 4.0)
(if (<= z -1.55e-208)
(* x -3.0)
(if (<= z 1.25e-275)
(* y 4.0)
(if (<= z 800000.0) (* x -3.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.0048) {
tmp = t_0;
} else if (z <= -3e-31) {
tmp = x * -3.0;
} else if (z <= -5.8e-152) {
tmp = y * 4.0;
} else if (z <= -1.55e-208) {
tmp = x * -3.0;
} else if (z <= 1.25e-275) {
tmp = y * 4.0;
} else if (z <= 800000.0) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
if (z <= (-0.0048d0)) then
tmp = t_0
else if (z <= (-3d-31)) then
tmp = x * (-3.0d0)
else if (z <= (-5.8d-152)) then
tmp = y * 4.0d0
else if (z <= (-1.55d-208)) then
tmp = x * (-3.0d0)
else if (z <= 1.25d-275) then
tmp = y * 4.0d0
else if (z <= 800000.0d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.0048) {
tmp = t_0;
} else if (z <= -3e-31) {
tmp = x * -3.0;
} else if (z <= -5.8e-152) {
tmp = y * 4.0;
} else if (z <= -1.55e-208) {
tmp = x * -3.0;
} else if (z <= 1.25e-275) {
tmp = y * 4.0;
} else if (z <= 800000.0) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -0.0048: tmp = t_0 elif z <= -3e-31: tmp = x * -3.0 elif z <= -5.8e-152: tmp = y * 4.0 elif z <= -1.55e-208: tmp = x * -3.0 elif z <= 1.25e-275: tmp = y * 4.0 elif z <= 800000.0: tmp = x * -3.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 <= -0.0048) tmp = t_0; elseif (z <= -3e-31) tmp = Float64(x * -3.0); elseif (z <= -5.8e-152) tmp = Float64(y * 4.0); elseif (z <= -1.55e-208) tmp = Float64(x * -3.0); elseif (z <= 1.25e-275) tmp = Float64(y * 4.0); elseif (z <= 800000.0) tmp = Float64(x * -3.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 <= -0.0048) tmp = t_0; elseif (z <= -3e-31) tmp = x * -3.0; elseif (z <= -5.8e-152) tmp = y * 4.0; elseif (z <= -1.55e-208) tmp = x * -3.0; elseif (z <= 1.25e-275) tmp = y * 4.0; elseif (z <= 800000.0) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0048], t$95$0, If[LessEqual[z, -3e-31], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.8e-152], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.55e-208], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.25e-275], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 800000.0], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -0.0048:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-31}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-208}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-275}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 800000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.00479999999999999958 or 8e5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 51.5%
metadata-eval51.5%
cancel-sign-sub-inv51.5%
*-commutative51.5%
cancel-sign-sub-inv51.5%
distribute-lft-neg-in51.5%
*-commutative51.5%
sub-neg51.5%
distribute-lft-in51.4%
metadata-eval51.4%
distribute-rgt-neg-out51.4%
distribute-lft-neg-in51.4%
metadata-eval51.4%
mul-1-neg51.4%
distribute-lft-in51.4%
metadata-eval51.4%
associate-+r+51.4%
metadata-eval51.4%
associate-*r*51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in z around 0 51.4%
Taylor expanded in z around inf 49.9%
if -0.00479999999999999958 < z < -2.99999999999999981e-31 or -5.8000000000000003e-152 < z < -1.5499999999999999e-208 or 1.24999999999999996e-275 < z < 8e5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 68.1%
metadata-eval68.1%
cancel-sign-sub-inv68.1%
*-commutative68.1%
cancel-sign-sub-inv68.1%
distribute-lft-neg-in68.1%
*-commutative68.1%
sub-neg68.1%
distribute-lft-in68.2%
metadata-eval68.2%
distribute-rgt-neg-out68.2%
distribute-lft-neg-in68.2%
metadata-eval68.2%
mul-1-neg68.2%
distribute-lft-in68.2%
metadata-eval68.2%
associate-+r+68.2%
metadata-eval68.2%
associate-*r*68.2%
metadata-eval68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -2.99999999999999981e-31 < z < -5.8000000000000003e-152 or -1.5499999999999999e-208 < z < 1.24999999999999996e-275Initial program 97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 70.9%
*-commutative70.9%
Simplified70.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z)))))
(if (<= y -2.9e-18)
t_0
(if (<= y 4.4e-282) (* x -3.0) (if (<= y 3.3e-41) (* 6.0 (* x z)) t_0)))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -2.9e-18) {
tmp = t_0;
} else if (y <= 4.4e-282) {
tmp = x * -3.0;
} else if (y <= 3.3e-41) {
tmp = 6.0 * (x * 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 * (y * (0.6666666666666666d0 - z))
if (y <= (-2.9d-18)) then
tmp = t_0
else if (y <= 4.4d-282) then
tmp = x * (-3.0d0)
else if (y <= 3.3d-41) then
tmp = 6.0d0 * (x * 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 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -2.9e-18) {
tmp = t_0;
} else if (y <= 4.4e-282) {
tmp = x * -3.0;
} else if (y <= 3.3e-41) {
tmp = 6.0 * (x * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) tmp = 0 if y <= -2.9e-18: tmp = t_0 elif y <= 4.4e-282: tmp = x * -3.0 elif y <= 3.3e-41: tmp = 6.0 * (x * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) tmp = 0.0 if (y <= -2.9e-18) tmp = t_0; elseif (y <= 4.4e-282) tmp = Float64(x * -3.0); elseif (y <= 3.3e-41) tmp = Float64(6.0 * Float64(x * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); tmp = 0.0; if (y <= -2.9e-18) tmp = t_0; elseif (y <= 4.4e-282) tmp = x * -3.0; elseif (y <= 3.3e-41) tmp = 6.0 * (x * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e-18], t$95$0, If[LessEqual[y, 4.4e-282], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, 3.3e-41], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{-18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-282}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-41}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.9e-18 or 3.30000000000000024e-41 < y Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around inf 99.0%
Taylor expanded in y around inf 76.5%
*-commutative76.5%
Simplified76.5%
if -2.9e-18 < y < 4.39999999999999962e-282Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 90.8%
metadata-eval90.8%
cancel-sign-sub-inv90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
distribute-lft-neg-in90.8%
*-commutative90.8%
sub-neg90.8%
distribute-lft-in90.8%
metadata-eval90.8%
distribute-rgt-neg-out90.8%
distribute-lft-neg-in90.8%
metadata-eval90.8%
mul-1-neg90.8%
distribute-lft-in90.8%
metadata-eval90.8%
associate-+r+90.9%
metadata-eval90.9%
associate-*r*90.9%
metadata-eval90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in z around 0 55.5%
*-commutative55.5%
Simplified55.5%
if 4.39999999999999962e-282 < y < 3.30000000000000024e-41Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 79.5%
metadata-eval79.5%
cancel-sign-sub-inv79.5%
*-commutative79.5%
cancel-sign-sub-inv79.5%
distribute-lft-neg-in79.5%
*-commutative79.5%
sub-neg79.5%
distribute-lft-in79.5%
metadata-eval79.5%
distribute-rgt-neg-out79.5%
distribute-lft-neg-in79.5%
metadata-eval79.5%
mul-1-neg79.5%
distribute-lft-in79.5%
metadata-eval79.5%
associate-+r+79.5%
metadata-eval79.5%
associate-*r*79.5%
metadata-eval79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in z around 0 79.6%
Taylor expanded in z around inf 45.9%
Final simplification65.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.66) (not (<= z 0.65))) (+ x (* -6.0 (* (- y x) z))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.66) || !(z <= 0.65)) {
tmp = x + (-6.0 * ((y - x) * z));
} 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.65d0))) then
tmp = x + ((-6.0d0) * ((y - x) * z))
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.65)) {
tmp = x + (-6.0 * ((y - x) * z));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.66) or not (z <= 0.65): tmp = x + (-6.0 * ((y - x) * z)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.66) || !(z <= 0.65)) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); 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.65))) tmp = x + (-6.0 * ((y - x) * z)); 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.65]], $MachinePrecision]], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $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.65\right):\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.650000000000000022 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 96.6%
if -0.660000000000000031 < z < 0.650000000000000022Initial program 98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in z around 0 97.8%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.5e+28) (not (<= y 4.9e-40))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e+28) || !(y <= 4.9e-40)) {
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 <= (-5.5d+28)) .or. (.not. (y <= 4.9d-40))) 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 <= -5.5e+28) || !(y <= 4.9e-40)) {
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 <= -5.5e+28) or not (y <= 4.9e-40): 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 <= -5.5e+28) || !(y <= 4.9e-40)) 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 <= -5.5e+28) || ~((y <= 4.9e-40))) 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, -5.5e+28], N[Not[LessEqual[y, 4.9e-40]], $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 -5.5 \cdot 10^{+28} \lor \neg \left(y \leq 4.9 \cdot 10^{-40}\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 < -5.5000000000000003e28 or 4.8999999999999997e-40 < y Initial program 99.0%
+-commutative99.0%
associate-*l*99.9%
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 inf 79.4%
if -5.5000000000000003e28 < y < 4.8999999999999997e-40Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 84.5%
metadata-eval84.5%
cancel-sign-sub-inv84.5%
*-commutative84.5%
cancel-sign-sub-inv84.5%
distribute-lft-neg-in84.5%
*-commutative84.5%
sub-neg84.5%
distribute-lft-in84.5%
metadata-eval84.5%
distribute-rgt-neg-out84.5%
distribute-lft-neg-in84.5%
metadata-eval84.5%
mul-1-neg84.5%
distribute-lft-in84.5%
metadata-eval84.5%
associate-+r+84.5%
metadata-eval84.5%
associate-*r*84.5%
metadata-eval84.5%
*-commutative84.5%
Simplified84.5%
Final simplification81.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.6e+28) (not (<= y 1.06e-36))) (* 6.0 (* y (- 0.6666666666666666 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.6e+28) || !(y <= 1.06e-36)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-2.6d+28)) .or. (.not. (y <= 1.06d-36))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.6e+28) || !(y <= 1.06e-36)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.6e+28) or not (y <= 1.06e-36): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.6e+28) || !(y <= 1.06e-36)) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.6e+28) || ~((y <= 1.06e-36))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.6e+28], N[Not[LessEqual[y, 1.06e-36]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+28} \lor \neg \left(y \leq 1.06 \cdot 10^{-36}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -2.6000000000000002e28 or 1.05999999999999999e-36 < y Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around inf 99.0%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
Simplified79.2%
if -2.6000000000000002e28 < y < 1.05999999999999999e-36Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 84.5%
metadata-eval84.5%
cancel-sign-sub-inv84.5%
*-commutative84.5%
cancel-sign-sub-inv84.5%
distribute-lft-neg-in84.5%
*-commutative84.5%
sub-neg84.5%
distribute-lft-in84.5%
metadata-eval84.5%
distribute-rgt-neg-out84.5%
distribute-lft-neg-in84.5%
metadata-eval84.5%
mul-1-neg84.5%
distribute-lft-in84.5%
metadata-eval84.5%
associate-+r+84.5%
metadata-eval84.5%
associate-*r*84.5%
metadata-eval84.5%
*-commutative84.5%
Simplified84.5%
Final simplification81.8%
(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.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.2e+28) (not (<= y 3.7e-34))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.2e+28) || !(y <= 3.7e-34)) {
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 <= (-1.2d+28)) .or. (.not. (y <= 3.7d-34))) 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 <= -1.2e+28) || !(y <= 3.7e-34)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.2e+28) or not (y <= 3.7e-34): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.2e+28) || !(y <= 3.7e-34)) 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 <= -1.2e+28) || ~((y <= 3.7e-34))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.2e+28], N[Not[LessEqual[y, 3.7e-34]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+28} \lor \neg \left(y \leq 3.7 \cdot 10^{-34}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -1.19999999999999991e28 or 3.69999999999999988e-34 < y Initial program 99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in z around 0 48.5%
Taylor expanded in x around 0 38.4%
*-commutative38.4%
Simplified38.4%
if -1.19999999999999991e28 < y < 3.69999999999999988e-34Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 83.8%
metadata-eval83.8%
cancel-sign-sub-inv83.8%
*-commutative83.8%
cancel-sign-sub-inv83.8%
distribute-lft-neg-in83.8%
*-commutative83.8%
sub-neg83.8%
distribute-lft-in83.8%
metadata-eval83.8%
distribute-rgt-neg-out83.8%
distribute-lft-neg-in83.8%
metadata-eval83.8%
mul-1-neg83.8%
distribute-lft-in83.8%
metadata-eval83.8%
associate-+r+83.8%
metadata-eval83.8%
associate-*r*83.8%
metadata-eval83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in z around 0 45.9%
*-commutative45.9%
Simplified45.9%
Final simplification42.1%
(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.2%
metadata-eval99.2%
Simplified99.2%
(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.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 53.6%
metadata-eval53.6%
cancel-sign-sub-inv53.6%
*-commutative53.6%
cancel-sign-sub-inv53.6%
distribute-lft-neg-in53.6%
*-commutative53.6%
sub-neg53.6%
distribute-lft-in53.6%
metadata-eval53.6%
distribute-rgt-neg-out53.6%
distribute-lft-neg-in53.6%
metadata-eval53.6%
mul-1-neg53.6%
distribute-lft-in53.6%
metadata-eval53.6%
associate-+r+53.6%
metadata-eval53.6%
associate-*r*53.6%
metadata-eval53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in z around 0 28.4%
*-commutative28.4%
Simplified28.4%
(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.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around inf 50.8%
Taylor expanded in z around 0 2.7%
herbie shell --seed 2024084
(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))))