
(FPCore (x y z t) :precision binary64 (* (- (* x y) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((x * y) - (z * y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * y) - (z * y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x * y) - (z * y)) * t;
}
def code(x, y, z, t): return ((x * y) - (z * y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x * y) - Float64(z * y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x * y) - (z * y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y - z \cdot y\right) \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (- (* x y) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((x * y) - (z * y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * y) - (z * y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x * y) - (z * y)) * t;
}
def code(x, y, z, t): return ((x * y) - (z * y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x * y) - Float64(z * y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x * y) - (z * y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y - z \cdot y\right) \cdot t
\end{array}
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 8.5e+108) (* y (* t (- x z))) (* (- x z) (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.5e+108) {
tmp = y * (t * (x - z));
} else {
tmp = (x - z) * (t * y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 8.5d+108) then
tmp = y * (t * (x - z))
else
tmp = (x - z) * (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.5e+108) {
tmp = y * (t * (x - z));
} else {
tmp = (x - z) * (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 8.5e+108: tmp = y * (t * (x - z)) else: tmp = (x - z) * (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 8.5e+108) tmp = Float64(y * Float64(t * Float64(x - z))); else tmp = Float64(Float64(x - z) * Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 8.5e+108)
tmp = y * (t * (x - z));
else
tmp = (x - z) * (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 8.5e+108], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.5 \cdot 10^{+108}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\
\end{array}
\end{array}
if t < 8.50000000000000016e108Initial program 87.2%
distribute-rgt-out--88.7%
associate-*l*91.0%
Simplified91.0%
if 8.50000000000000016e108 < t Initial program 90.4%
distribute-rgt-out--92.4%
associate-*l*86.8%
Simplified86.8%
add-cube-cbrt86.0%
pow386.0%
Applied egg-rr86.0%
rem-cube-cbrt86.8%
*-commutative86.8%
associate-*r*94.5%
remove-double-div94.5%
div-inv94.5%
*-commutative94.5%
associate-/l*92.3%
clear-num92.3%
associate-/r/92.3%
/-rgt-identity92.3%
sub-neg92.3%
add-sqr-sqrt37.3%
sqrt-unprod65.4%
sqr-neg65.4%
sqrt-unprod29.8%
add-sqr-sqrt47.7%
Applied egg-rr47.7%
frac-2neg47.7%
distribute-lft-neg-in47.7%
add-sqr-sqrt19.8%
sqrt-unprod24.4%
sqr-neg24.4%
sqrt-unprod19.7%
add-sqr-sqrt43.7%
distribute-neg-frac43.7%
neg-sub041.7%
frac-2neg41.7%
metadata-eval41.7%
distribute-lft-neg-in41.7%
add-sqr-sqrt20.0%
sqrt-unprod38.5%
sqr-neg38.5%
sqrt-unprod23.9%
add-sqr-sqrt51.6%
distribute-rgt-in49.6%
*-commutative49.6%
*-commutative49.6%
add-sqr-sqrt28.0%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod45.4%
add-sqr-sqrt80.6%
distribute-rgt-neg-in80.6%
Applied egg-rr82.5%
neg-sub092.3%
distribute-neg-frac92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in t around 0 86.8%
associate-*r*94.5%
*-commutative94.5%
Simplified94.5%
Final simplification91.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.25e+115) (not (<= z 1.4e+64))) (* (- y) (* t z)) (* x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e+115) || !(z <= 1.4e+64)) {
tmp = -y * (t * z);
} else {
tmp = x * (t * y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.25d+115)) .or. (.not. (z <= 1.4d+64))) then
tmp = -y * (t * z)
else
tmp = x * (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.25e+115) || !(z <= 1.4e+64)) {
tmp = -y * (t * z);
} else {
tmp = x * (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.25e+115) or not (z <= 1.4e+64): tmp = -y * (t * z) else: tmp = x * (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.25e+115) || !(z <= 1.4e+64)) tmp = Float64(Float64(-y) * Float64(t * z)); else tmp = Float64(x * Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.25e+115) || ~((z <= 1.4e+64)))
tmp = -y * (t * z);
else
tmp = x * (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.25e+115], N[Not[LessEqual[z, 1.4e+64]], $MachinePrecision]], N[((-y) * N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+115} \lor \neg \left(z \leq 1.4 \cdot 10^{+64}\right):\\
\;\;\;\;\left(-y\right) \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot y\right)\\
\end{array}
\end{array}
if z < -1.25000000000000002e115 or 1.40000000000000012e64 < z Initial program 85.9%
distribute-rgt-out--90.5%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in x around 0 80.9%
associate-*r*80.9%
neg-mul-180.9%
Simplified80.9%
if -1.25000000000000002e115 < z < 1.40000000000000012e64Initial program 88.9%
distribute-rgt-out--88.9%
associate-*l*91.8%
Simplified91.8%
add-cube-cbrt90.8%
pow390.7%
Applied egg-rr90.7%
rem-cube-cbrt91.8%
*-commutative91.8%
associate-*r*93.4%
remove-double-div93.4%
div-inv93.4%
frac-2neg93.4%
metadata-eval93.4%
associate-/r/93.4%
sub-neg93.4%
distribute-neg-in93.4%
add-sqr-sqrt52.3%
sqrt-unprod83.0%
sqr-neg83.0%
sqrt-unprod30.9%
add-sqr-sqrt71.1%
add-sqr-sqrt40.1%
sqrt-unprod80.4%
sqr-neg80.4%
sqrt-unprod41.0%
add-sqr-sqrt93.4%
Applied egg-rr93.4%
Taylor expanded in x around inf 69.5%
associate-*r*74.0%
Simplified74.0%
Final simplification76.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.22e+115) (* (- y) (* t z)) (if (<= z 2e+64) (* x (* t y)) (* z (* t (- y))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.22e+115) {
tmp = -y * (t * z);
} else if (z <= 2e+64) {
tmp = x * (t * y);
} else {
tmp = z * (t * -y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.22d+115)) then
tmp = -y * (t * z)
else if (z <= 2d+64) then
tmp = x * (t * y)
else
tmp = z * (t * -y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.22e+115) {
tmp = -y * (t * z);
} else if (z <= 2e+64) {
tmp = x * (t * y);
} else {
tmp = z * (t * -y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -1.22e+115: tmp = -y * (t * z) elif z <= 2e+64: tmp = x * (t * y) else: tmp = z * (t * -y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.22e+115) tmp = Float64(Float64(-y) * Float64(t * z)); elseif (z <= 2e+64) tmp = Float64(x * Float64(t * y)); else tmp = Float64(z * Float64(t * Float64(-y))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.22e+115)
tmp = -y * (t * z);
elseif (z <= 2e+64)
tmp = x * (t * y);
else
tmp = z * (t * -y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.22e+115], N[((-y) * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+64], N[(x * N[(t * y), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+115}:\\
\;\;\;\;\left(-y\right) \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+64}:\\
\;\;\;\;x \cdot \left(t \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if z < -1.22e115Initial program 88.2%
distribute-rgt-out--93.2%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around 0 87.0%
associate-*r*87.0%
neg-mul-187.0%
Simplified87.0%
if -1.22e115 < z < 2.00000000000000004e64Initial program 88.9%
distribute-rgt-out--88.9%
associate-*l*91.8%
Simplified91.8%
add-cube-cbrt90.8%
pow390.7%
Applied egg-rr90.7%
rem-cube-cbrt91.8%
*-commutative91.8%
associate-*r*93.4%
remove-double-div93.4%
div-inv93.4%
frac-2neg93.4%
metadata-eval93.4%
associate-/r/93.4%
sub-neg93.4%
distribute-neg-in93.4%
add-sqr-sqrt52.3%
sqrt-unprod83.0%
sqr-neg83.0%
sqrt-unprod30.9%
add-sqr-sqrt71.1%
add-sqr-sqrt40.1%
sqrt-unprod80.4%
sqr-neg80.4%
sqrt-unprod41.0%
add-sqr-sqrt93.4%
Applied egg-rr93.4%
Taylor expanded in x around inf 69.5%
associate-*r*74.0%
Simplified74.0%
if 2.00000000000000004e64 < z Initial program 83.8%
distribute-rgt-out--88.1%
Simplified88.1%
Taylor expanded in x around 0 79.6%
neg-mul-179.6%
*-commutative79.6%
distribute-rgt-neg-in79.6%
Simplified79.6%
associate-*l*82.3%
distribute-lft-neg-in82.3%
/-rgt-identity82.3%
metadata-eval82.3%
frac-2neg82.3%
clear-num80.8%
un-div-inv80.7%
Applied egg-rr80.7%
associate-/r/82.3%
Simplified82.3%
Taylor expanded in z around 0 75.6%
mul-1-neg75.6%
associate-*r*82.3%
distribute-rgt-neg-in82.3%
Simplified82.3%
Final simplification77.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.1e-83) (* y (* t (- x z))) (* t (* y (- x z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-83) {
tmp = y * (t * (x - z));
} else {
tmp = t * (y * (x - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.1d-83)) then
tmp = y * (t * (x - z))
else
tmp = t * (y * (x - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-83) {
tmp = y * (t * (x - z));
} else {
tmp = t * (y * (x - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.1e-83: tmp = y * (t * (x - z)) else: tmp = t * (y * (x - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e-83) tmp = Float64(y * Float64(t * Float64(x - z))); else tmp = Float64(t * Float64(y * Float64(x - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.1e-83)
tmp = y * (t * (x - z));
else
tmp = t * (y * (x - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e-83], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-83}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\end{array}
\end{array}
if y < -1.10000000000000004e-83Initial program 80.9%
distribute-rgt-out--85.3%
associate-*l*99.7%
Simplified99.7%
if -1.10000000000000004e-83 < y Initial program 90.5%
distribute-rgt-out--91.0%
Simplified91.0%
Final simplification93.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 1.1e+36) (* y (* t x)) (* x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.1e+36) {
tmp = y * (t * x);
} else {
tmp = x * (t * y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.1d+36) then
tmp = y * (t * x)
else
tmp = x * (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.1e+36) {
tmp = y * (t * x);
} else {
tmp = x * (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 1.1e+36: tmp = y * (t * x) else: tmp = x * (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1.1e+36) tmp = Float64(y * Float64(t * x)); else tmp = Float64(x * Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.1e+36)
tmp = y * (t * x);
else
tmp = x * (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 1.1e+36], N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.1 \cdot 10^{+36}:\\
\;\;\;\;y \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot y\right)\\
\end{array}
\end{array}
if t < 1.1e36Initial program 86.7%
distribute-rgt-out--88.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around inf 53.2%
if 1.1e36 < t Initial program 91.0%
distribute-rgt-out--92.5%
associate-*l*89.7%
Simplified89.7%
add-cube-cbrt88.8%
pow388.8%
Applied egg-rr88.8%
rem-cube-cbrt89.7%
*-commutative89.7%
associate-*r*94.2%
remove-double-div94.2%
div-inv94.2%
frac-2neg94.2%
metadata-eval94.2%
associate-/r/94.2%
sub-neg94.2%
distribute-neg-in94.2%
add-sqr-sqrt40.8%
sqrt-unprod61.6%
sqr-neg61.6%
sqrt-unprod24.9%
add-sqr-sqrt44.8%
add-sqr-sqrt19.8%
sqrt-unprod71.5%
sqr-neg71.5%
sqrt-unprod53.2%
add-sqr-sqrt94.2%
Applied egg-rr94.2%
Taylor expanded in x around inf 47.4%
associate-*r*53.2%
Simplified53.2%
Final simplification53.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* y (* t (- x z))))
assert(y < t);
double code(double x, double y, double z, double t) {
return y * (t * (x - z));
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * (t * (x - z))
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return y * (t * (x - z));
}
[y, t] = sort([y, t]) def code(x, y, z, t): return y * (t * (x - z))
y, t = sort([y, t]) function code(x, y, z, t) return Float64(y * Float64(t * Float64(x - z))) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = y * (t * (x - z));
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
y \cdot \left(t \cdot \left(x - z\right)\right)
\end{array}
Initial program 87.8%
distribute-rgt-out--89.4%
associate-*l*90.2%
Simplified90.2%
Final simplification90.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* y (* t x)))
assert(y < t);
double code(double x, double y, double z, double t) {
return y * (t * x);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * (t * x)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return y * (t * x);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return y * (t * x)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(y * Float64(t * x)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = y * (t * x);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
y \cdot \left(t \cdot x\right)
\end{array}
Initial program 87.8%
distribute-rgt-out--89.4%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in x around inf 51.7%
Final simplification51.7%
(FPCore (x y z t) :precision binary64 (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t < -9.231879582886777e-80) {
tmp = (y * t) * (x - z);
} else if (t < 2.543067051564877e+83) {
tmp = y * (t * (x - z));
} else {
tmp = (y * (x - z)) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t < (-9.231879582886777d-80)) then
tmp = (y * t) * (x - z)
else if (t < 2.543067051564877d+83) then
tmp = y * (t * (x - z))
else
tmp = (y * (x - z)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t < -9.231879582886777e-80) {
tmp = (y * t) * (x - z);
} else if (t < 2.543067051564877e+83) {
tmp = y * (t * (x - z));
} else {
tmp = (y * (x - z)) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t < -9.231879582886777e-80: tmp = (y * t) * (x - z) elif t < 2.543067051564877e+83: tmp = y * (t * (x - z)) else: tmp = (y * (x - z)) * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t < -9.231879582886777e-80) tmp = Float64(Float64(y * t) * Float64(x - z)); elseif (t < 2.543067051564877e+83) tmp = Float64(y * Float64(t * Float64(x - z))); else tmp = Float64(Float64(y * Float64(x - z)) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t < -9.231879582886777e-80) tmp = (y * t) * (x - z); elseif (t < 2.543067051564877e+83) tmp = y * (t * (x - z)); else tmp = (y * (x - z)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Less[t, -9.231879582886777e-80], N[(N[(y * t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], If[Less[t, 2.543067051564877e+83], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t < -9.231879582886777 \cdot 10^{-80}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\
\mathbf{elif}\;t < 2.543067051564877 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\
\end{array}
\end{array}
herbie shell --seed 2023199
(FPCore (x y z t)
:name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))
(* (- (* x y) (* z y)) t))