
(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 8 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 (<= y -300000000.0) (* (- x z) (* y t)) (* t (- (* y x) (* y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -300000000.0) {
tmp = (x - z) * (y * t);
} else {
tmp = t * ((y * x) - (y * 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 <= (-300000000.0d0)) then
tmp = (x - z) * (y * t)
else
tmp = t * ((y * x) - (y * 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 <= -300000000.0) {
tmp = (x - z) * (y * t);
} else {
tmp = t * ((y * x) - (y * z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -300000000.0: tmp = (x - z) * (y * t) else: tmp = t * ((y * x) - (y * z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -300000000.0) tmp = Float64(Float64(x - z) * Float64(y * t)); else tmp = Float64(t * Float64(Float64(y * x) - Float64(y * z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -300000000.0)
tmp = (x - z) * (y * t);
else
tmp = t * ((y * x) - (y * 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, -300000000.0], N[(N[(x - z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y * x), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -300000000:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -3e8Initial program 82.3%
*-commutative82.3%
distribute-rgt-out--85.2%
associate-*r*98.4%
*-commutative98.4%
Simplified98.4%
if -3e8 < y Initial program 94.1%
Final simplification95.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -4.3e-20) (not (<= z 9e-54))) (* y (* t (- z))) (* t (* y x))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.3e-20) || !(z <= 9e-54)) {
tmp = y * (t * -z);
} else {
tmp = t * (y * x);
}
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 <= (-4.3d-20)) .or. (.not. (z <= 9d-54))) then
tmp = y * (t * -z)
else
tmp = t * (y * x)
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 <= -4.3e-20) || !(z <= 9e-54)) {
tmp = y * (t * -z);
} else {
tmp = t * (y * x);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -4.3e-20) or not (z <= 9e-54): tmp = y * (t * -z) else: tmp = t * (y * x) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -4.3e-20) || !(z <= 9e-54)) tmp = Float64(y * Float64(t * Float64(-z))); else tmp = Float64(t * Float64(y * x)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -4.3e-20) || ~((z <= 9e-54)))
tmp = y * (t * -z);
else
tmp = t * (y * x);
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, -4.3e-20], N[Not[LessEqual[z, 9e-54]], $MachinePrecision]], N[(y * N[(t * (-z)), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-20} \lor \neg \left(z \leq 9 \cdot 10^{-54}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if z < -4.30000000000000011e-20 or 8.9999999999999997e-54 < z Initial program 87.1%
distribute-rgt-out--88.6%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x around 0 78.6%
mul-1-neg78.6%
distribute-rgt-neg-out78.6%
Simplified78.6%
if -4.30000000000000011e-20 < z < 8.9999999999999997e-54Initial program 95.6%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in x around inf 84.0%
*-commutative84.0%
Simplified84.0%
Final simplification81.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -6.9e-14) (* z (* y (- t))) (if (<= z 7.2e-52) (* t (* y x)) (* y (* t (- z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.9e-14) {
tmp = z * (y * -t);
} else if (z <= 7.2e-52) {
tmp = t * (y * x);
} else {
tmp = y * (t * -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 (z <= (-6.9d-14)) then
tmp = z * (y * -t)
else if (z <= 7.2d-52) then
tmp = t * (y * x)
else
tmp = y * (t * -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 (z <= -6.9e-14) {
tmp = z * (y * -t);
} else if (z <= 7.2e-52) {
tmp = t * (y * x);
} else {
tmp = y * (t * -z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -6.9e-14: tmp = z * (y * -t) elif z <= 7.2e-52: tmp = t * (y * x) else: tmp = y * (t * -z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.9e-14) tmp = Float64(z * Float64(y * Float64(-t))); elseif (z <= 7.2e-52) tmp = Float64(t * Float64(y * x)); else tmp = Float64(y * Float64(t * Float64(-z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -6.9e-14)
tmp = z * (y * -t);
elseif (z <= 7.2e-52)
tmp = t * (y * x);
else
tmp = y * (t * -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[z, -6.9e-14], N[(z * N[(y * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-52], N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(y * N[(t * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.9 \cdot 10^{-14}:\\
\;\;\;\;z \cdot \left(y \cdot \left(-t\right)\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-52}:\\
\;\;\;\;t \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if z < -6.89999999999999963e-14Initial program 90.3%
distribute-rgt-out--91.9%
Simplified91.9%
flip--59.1%
associate-*r/57.7%
pow257.7%
pow257.7%
Applied egg-rr57.7%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in x around 0 77.0%
mul-1-neg77.0%
associate-*r*79.6%
*-commutative79.6%
*-commutative79.6%
distribute-rgt-neg-in79.6%
distribute-lft-neg-in79.6%
*-commutative79.6%
Simplified79.6%
if -6.89999999999999963e-14 < z < 7.19999999999999976e-52Initial program 95.6%
distribute-rgt-out--95.6%
Simplified95.6%
Taylor expanded in x around inf 84.0%
*-commutative84.0%
Simplified84.0%
if 7.19999999999999976e-52 < z Initial program 83.8%
distribute-rgt-out--85.2%
associate-*l*90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in x around 0 77.5%
mul-1-neg77.5%
distribute-rgt-neg-out77.5%
Simplified77.5%
Final simplification81.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 4.2e-106) (* y (* t (- x z))) (* (- x z) (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.2e-106) {
tmp = y * (t * (x - z));
} else {
tmp = (x - z) * (y * t);
}
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 <= 4.2d-106) then
tmp = y * (t * (x - z))
else
tmp = (x - z) * (y * t)
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 <= 4.2e-106) {
tmp = y * (t * (x - z));
} else {
tmp = (x - z) * (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 4.2e-106: tmp = y * (t * (x - z)) else: tmp = (x - z) * (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.2e-106) tmp = Float64(y * Float64(t * Float64(x - z))); else tmp = Float64(Float64(x - z) * Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 4.2e-106)
tmp = y * (t * (x - z));
else
tmp = (x - z) * (y * t);
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, 4.2e-106], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.2 \cdot 10^{-106}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if t < 4.20000000000000007e-106Initial program 87.3%
distribute-rgt-out--88.0%
associate-*l*90.5%
*-commutative90.5%
Simplified90.5%
if 4.20000000000000007e-106 < t Initial program 96.8%
*-commutative96.8%
distribute-rgt-out--97.9%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification94.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -300000000.0) (* (- x z) (* y t)) (* t (* y (- x z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -300000000.0) {
tmp = (x - z) * (y * t);
} 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 <= (-300000000.0d0)) then
tmp = (x - z) * (y * t)
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 <= -300000000.0) {
tmp = (x - z) * (y * t);
} else {
tmp = t * (y * (x - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -300000000.0: tmp = (x - z) * (y * t) else: tmp = t * (y * (x - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -300000000.0) tmp = Float64(Float64(x - z) * Float64(y * t)); 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 <= -300000000.0)
tmp = (x - z) * (y * t);
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, -300000000.0], N[(N[(x - z), $MachinePrecision] * N[(y * t), $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 -300000000:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\end{array}
\end{array}
if y < -3e8Initial program 82.3%
*-commutative82.3%
distribute-rgt-out--85.2%
associate-*r*98.4%
*-commutative98.4%
Simplified98.4%
if -3e8 < y Initial program 94.1%
distribute-rgt-out--94.2%
Simplified94.2%
Final simplification95.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 5.4e-120) (* y (* t x)) (* x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.4e-120) {
tmp = y * (t * x);
} else {
tmp = x * (y * t);
}
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 <= 5.4d-120) then
tmp = y * (t * x)
else
tmp = x * (y * t)
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 <= 5.4e-120) {
tmp = y * (t * x);
} else {
tmp = x * (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= 5.4e-120: tmp = y * (t * x) else: tmp = x * (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 5.4e-120) tmp = Float64(y * Float64(t * x)); else tmp = Float64(x * Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 5.4e-120)
tmp = y * (t * x);
else
tmp = x * (y * t);
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, 5.4e-120], N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.4 \cdot 10^{-120}:\\
\;\;\;\;y \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if t < 5.3999999999999997e-120Initial program 87.0%
distribute-rgt-out--87.8%
associate-*l*90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in x around inf 49.1%
if 5.3999999999999997e-120 < t Initial program 96.9%
distribute-rgt-out--97.9%
Simplified97.9%
flip--75.7%
associate-*r/71.8%
pow271.8%
pow271.8%
Applied egg-rr71.8%
associate-/l*75.6%
Simplified75.6%
Taylor expanded in x around inf 54.3%
*-commutative54.3%
associate-*r*58.2%
*-commutative58.2%
Simplified58.2%
Final simplification52.6%
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 90.9%
distribute-rgt-out--91.7%
associate-*l*91.0%
*-commutative91.0%
Simplified91.0%
Final simplification91.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* x (* y t)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x * (y * t);
}
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 = x * (y * t)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return x * (y * t);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x * (y * t)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x * Float64(y * t)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x * (y * t);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
x \cdot \left(y \cdot t\right)
\end{array}
Initial program 90.9%
distribute-rgt-out--91.7%
Simplified91.7%
flip--64.9%
associate-*r/62.7%
pow262.7%
pow262.7%
Applied egg-rr62.7%
associate-/l*64.9%
Simplified64.9%
Taylor expanded in x around inf 51.5%
*-commutative51.5%
associate-*r*51.9%
*-commutative51.9%
Simplified51.9%
Final simplification51.9%
(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 2023318
(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))