
(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 -2.4e+67) (* 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 <= -2.4e+67) {
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 <= (-2.4d+67)) 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 <= -2.4e+67) {
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 <= -2.4e+67: 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 <= -2.4e+67) 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 <= -2.4e+67)
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, -2.4e+67], 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 -2.4 \cdot 10^{+67}:\\
\;\;\;\;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 < -2.40000000000000002e67Initial program 76.0%
distribute-rgt-out--84.5%
associate-*l*97.9%
*-commutative97.9%
Simplified97.9%
if -2.40000000000000002e67 < y Initial program 94.2%
distribute-rgt-out--96.6%
Simplified96.6%
Final simplification96.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.45e+61) (not (<= z 1.6e+47))) (* t (* y (- z))) (* y (* t x))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.45e+61) || !(z <= 1.6e+47)) {
tmp = t * (y * -z);
} else {
tmp = y * (t * 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 <= (-2.45d+61)) .or. (.not. (z <= 1.6d+47))) then
tmp = t * (y * -z)
else
tmp = y * (t * 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 <= -2.45e+61) || !(z <= 1.6e+47)) {
tmp = t * (y * -z);
} else {
tmp = y * (t * x);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.45e+61) or not (z <= 1.6e+47): tmp = t * (y * -z) else: tmp = y * (t * x) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.45e+61) || !(z <= 1.6e+47)) tmp = Float64(t * Float64(y * Float64(-z))); else tmp = Float64(y * Float64(t * x)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.45e+61) || ~((z <= 1.6e+47)))
tmp = t * (y * -z);
else
tmp = y * (t * 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, -2.45e+61], N[Not[LessEqual[z, 1.6e+47]], $MachinePrecision]], N[(t * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(y * N[(t * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+61} \lor \neg \left(z \leq 1.6 \cdot 10^{+47}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot x\right)\\
\end{array}
\end{array}
if z < -2.45000000000000013e61 or 1.6e47 < z Initial program 88.6%
distribute-rgt-out--95.5%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in x around 0 81.4%
mul-1-neg81.4%
distribute-rgt-neg-in81.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if -2.45000000000000013e61 < z < 1.6e47Initial program 93.1%
distribute-rgt-out--93.1%
associate-*l*93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in x around inf 76.5%
associate-*r*76.4%
*-commutative76.4%
Simplified76.4%
Final simplification79.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.5e+64) (* t (* y (- z))) (if (<= z 3.9e+47) (* y (* t x)) (* y (* t (- z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e+64) {
tmp = t * (y * -z);
} else if (z <= 3.9e+47) {
tmp = y * (t * 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 <= (-3.5d+64)) then
tmp = t * (y * -z)
else if (z <= 3.9d+47) then
tmp = y * (t * 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 <= -3.5e+64) {
tmp = t * (y * -z);
} else if (z <= 3.9e+47) {
tmp = y * (t * x);
} else {
tmp = y * (t * -z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -3.5e+64: tmp = t * (y * -z) elif z <= 3.9e+47: tmp = y * (t * x) else: tmp = y * (t * -z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e+64) tmp = Float64(t * Float64(y * Float64(-z))); elseif (z <= 3.9e+47) tmp = Float64(y * Float64(t * 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 <= -3.5e+64)
tmp = t * (y * -z);
elseif (z <= 3.9e+47)
tmp = y * (t * 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, -3.5e+64], N[(t * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+47], N[(y * N[(t * 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 -3.5 \cdot 10^{+64}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+47}:\\
\;\;\;\;y \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if z < -3.4999999999999999e64Initial program 92.4%
distribute-rgt-out--99.8%
associate-*l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 89.9%
mul-1-neg89.9%
distribute-rgt-neg-in89.9%
distribute-rgt-neg-in89.9%
Simplified89.9%
if -3.4999999999999999e64 < z < 3.90000000000000025e47Initial program 93.1%
distribute-rgt-out--93.1%
associate-*l*93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in x around inf 76.5%
associate-*r*76.4%
*-commutative76.4%
Simplified76.4%
if 3.90000000000000025e47 < z Initial program 85.9%
distribute-rgt-out--92.4%
associate-*l*88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in x around 0 75.5%
mul-1-neg75.5%
associate-*r*69.4%
*-commutative69.4%
distribute-rgt-neg-out69.4%
associate-*l*71.1%
Simplified71.1%
Final simplification77.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 3.6e+19) (* 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 <= 3.6e+19) {
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 <= 3.6d+19) 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 <= 3.6e+19) {
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 <= 3.6e+19: 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 <= 3.6e+19) 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 <= 3.6e+19)
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, 3.6e+19], 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 3.6 \cdot 10^{+19}:\\
\;\;\;\;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 < 3.6e19Initial program 90.4%
distribute-rgt-out--93.8%
associate-*l*92.8%
*-commutative92.8%
Simplified92.8%
if 3.6e19 < t Initial program 92.4%
*-commutative92.4%
distribute-rgt-out--96.3%
associate-*r*98.0%
*-commutative98.0%
Simplified98.0%
Final simplification93.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.5e-55) (* x (* y t)) (* t (* y x))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e-55) {
tmp = x * (y * t);
} 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 (y <= (-1.5d-55)) then
tmp = x * (y * t)
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 (y <= -1.5e-55) {
tmp = x * (y * t);
} else {
tmp = t * (y * x);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.5e-55: tmp = x * (y * t) else: tmp = t * (y * x) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.5e-55) tmp = Float64(x * Float64(y * t)); 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 (y <= -1.5e-55)
tmp = x * (y * t);
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[LessEqual[y, -1.5e-55], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-55}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if y < -1.50000000000000008e-55Initial program 83.6%
distribute-rgt-out--89.4%
associate-*l*97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in x around inf 46.8%
*-commutative46.8%
associate-*r*55.3%
*-commutative55.3%
Simplified55.3%
if -1.50000000000000008e-55 < y Initial program 93.5%
distribute-rgt-out--96.2%
associate-*l*89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in x around inf 50.1%
*-commutative50.1%
Simplified50.1%
Final simplification51.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 5e+19) (* y (* t x)) (* x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5e+19) {
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 <= 5d+19) 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 <= 5e+19) {
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 <= 5e+19: 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 <= 5e+19) 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 <= 5e+19)
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, 5e+19], 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 \cdot 10^{+19}:\\
\;\;\;\;y \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if t < 5e19Initial program 90.4%
distribute-rgt-out--93.8%
associate-*l*92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in x around inf 48.6%
associate-*r*49.7%
*-commutative49.7%
Simplified49.7%
if 5e19 < t Initial program 92.4%
distribute-rgt-out--96.3%
associate-*l*85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in x around inf 51.6%
*-commutative51.6%
associate-*r*55.2%
*-commutative55.2%
Simplified55.2%
Final simplification50.8%
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.8%
distribute-rgt-out--94.3%
associate-*l*91.3%
*-commutative91.3%
Simplified91.3%
Final simplification91.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* t (* y x)))
assert(y < t);
double code(double x, double y, double z, double t) {
return t * (y * 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 = t * (y * x)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return t * (y * x);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return t * (y * x)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(t * Float64(y * x)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = t * (y * x);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
t \cdot \left(y \cdot x\right)
\end{array}
Initial program 90.8%
distribute-rgt-out--94.3%
associate-*l*91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in x around inf 49.2%
*-commutative49.2%
Simplified49.2%
Final simplification49.2%
(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 2023308
(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))