
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
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) / (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
def code(x, y, z, t): return x * ((y - z) / (t - z))
function code(x, y, z, t) return Float64(x * Float64(Float64(y - z) / Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x * ((y - z) / (t - z)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 84.4%
associate-*r/97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.08e-14) x (if (<= z 4.5e-68) (* x (/ y t)) (if (<= z 1.85e+99) (* x (/ (- y) z)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.08e-14) {
tmp = x;
} else if (z <= 4.5e-68) {
tmp = x * (y / t);
} else if (z <= 1.85e+99) {
tmp = x * (-y / z);
} else {
tmp = x;
}
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 (z <= (-1.08d-14)) then
tmp = x
else if (z <= 4.5d-68) then
tmp = x * (y / t)
else if (z <= 1.85d+99) then
tmp = x * (-y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.08e-14) {
tmp = x;
} else if (z <= 4.5e-68) {
tmp = x * (y / t);
} else if (z <= 1.85e+99) {
tmp = x * (-y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.08e-14: tmp = x elif z <= 4.5e-68: tmp = x * (y / t) elif z <= 1.85e+99: tmp = x * (-y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.08e-14) tmp = x; elseif (z <= 4.5e-68) tmp = Float64(x * Float64(y / t)); elseif (z <= 1.85e+99) tmp = Float64(x * Float64(Float64(-y) / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.08e-14) tmp = x; elseif (z <= 4.5e-68) tmp = x * (y / t); elseif (z <= 1.85e+99) tmp = x * (-y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.08e-14], x, If[LessEqual[z, 4.5e-68], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+99], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.08000000000000004e-14 or 1.85000000000000005e99 < z Initial program 72.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 67.2%
if -1.08000000000000004e-14 < z < 4.49999999999999999e-68Initial program 93.3%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in z around 0 72.6%
if 4.49999999999999999e-68 < z < 1.85000000000000005e99Initial program 91.6%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around inf 60.3%
Taylor expanded in t around 0 48.8%
associate-*r/48.8%
neg-mul-148.8%
Simplified48.8%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (<= z -2.5e-14) x (if (<= z 3.45e-68) (* x (/ y t)) (if (<= z 1.5e+99) (* y (/ (- x) z)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e-14) {
tmp = x;
} else if (z <= 3.45e-68) {
tmp = x * (y / t);
} else if (z <= 1.5e+99) {
tmp = y * (-x / z);
} else {
tmp = x;
}
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 (z <= (-2.5d-14)) then
tmp = x
else if (z <= 3.45d-68) then
tmp = x * (y / t)
else if (z <= 1.5d+99) then
tmp = y * (-x / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e-14) {
tmp = x;
} else if (z <= 3.45e-68) {
tmp = x * (y / t);
} else if (z <= 1.5e+99) {
tmp = y * (-x / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.5e-14: tmp = x elif z <= 3.45e-68: tmp = x * (y / t) elif z <= 1.5e+99: tmp = y * (-x / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.5e-14) tmp = x; elseif (z <= 3.45e-68) tmp = Float64(x * Float64(y / t)); elseif (z <= 1.5e+99) tmp = Float64(y * Float64(Float64(-x) / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.5e-14) tmp = x; elseif (z <= 3.45e-68) tmp = x * (y / t); elseif (z <= 1.5e+99) tmp = y * (-x / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.5e-14], x, If[LessEqual[z, 3.45e-68], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+99], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.45 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+99}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.5000000000000001e-14 or 1.50000000000000007e99 < z Initial program 72.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 67.2%
if -2.5000000000000001e-14 < z < 3.45000000000000016e-68Initial program 93.3%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in z around 0 72.6%
if 3.45000000000000016e-68 < z < 1.50000000000000007e99Initial program 91.6%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around inf 60.3%
Taylor expanded in t around 0 46.2%
mul-1-neg46.2%
associate-*r/48.8%
distribute-rgt-neg-in48.8%
Simplified48.8%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.02e-14) x (if (<= z 4.2e-68) (* x (/ y t)) (if (<= z 1.6e+99) (/ x (/ (- z) y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.02e-14) {
tmp = x;
} else if (z <= 4.2e-68) {
tmp = x * (y / t);
} else if (z <= 1.6e+99) {
tmp = x / (-z / y);
} else {
tmp = x;
}
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 (z <= (-1.02d-14)) then
tmp = x
else if (z <= 4.2d-68) then
tmp = x * (y / t)
else if (z <= 1.6d+99) then
tmp = x / (-z / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.02e-14) {
tmp = x;
} else if (z <= 4.2e-68) {
tmp = x * (y / t);
} else if (z <= 1.6e+99) {
tmp = x / (-z / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.02e-14: tmp = x elif z <= 4.2e-68: tmp = x * (y / t) elif z <= 1.6e+99: tmp = x / (-z / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.02e-14) tmp = x; elseif (z <= 4.2e-68) tmp = Float64(x * Float64(y / t)); elseif (z <= 1.6e+99) tmp = Float64(x / Float64(Float64(-z) / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.02e-14) tmp = x; elseif (z <= 4.2e-68) tmp = x * (y / t); elseif (z <= 1.6e+99) tmp = x / (-z / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.02e-14], x, If[LessEqual[z, 4.2e-68], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+99], N[(x / N[((-z) / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+99}:\\
\;\;\;\;\frac{x}{\frac{-z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.02e-14 or 1.6e99 < z Initial program 72.1%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 67.2%
if -1.02e-14 < z < 4.20000000000000016e-68Initial program 93.3%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in z around 0 72.6%
if 4.20000000000000016e-68 < z < 1.6e99Initial program 91.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 59.9%
neg-mul-159.9%
distribute-neg-frac59.9%
Simplified59.9%
Taylor expanded in z around 0 48.9%
associate-*r/48.9%
mul-1-neg48.9%
Simplified48.9%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.8e+116) (not (<= z 7.2e+92))) (- x (* y (/ x z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+116) || !(z <= 7.2e+92)) {
tmp = x - (y * (x / z));
} else {
tmp = x * (y / (t - z));
}
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 ((z <= (-3.8d+116)) .or. (.not. (z <= 7.2d+92))) then
tmp = x - (y * (x / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+116) || !(z <= 7.2e+92)) {
tmp = x - (y * (x / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.8e+116) or not (z <= 7.2e+92): tmp = x - (y * (x / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.8e+116) || !(z <= 7.2e+92)) tmp = Float64(x - Float64(y * Float64(x / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.8e+116) || ~((z <= 7.2e+92))) tmp = x - (y * (x / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.8e+116], N[Not[LessEqual[z, 7.2e+92]], $MachinePrecision]], N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+116} \lor \neg \left(z \leq 7.2 \cdot 10^{+92}\right):\\
\;\;\;\;x - y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -3.7999999999999999e116 or 7.2e92 < z Initial program 69.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 88.4%
neg-mul-188.4%
distribute-neg-frac88.4%
Simplified88.4%
Taylor expanded in z around 0 78.4%
+-commutative78.4%
mul-1-neg78.4%
unsub-neg78.4%
associate-*r/83.1%
Simplified83.1%
if -3.7999999999999999e116 < z < 7.2e92Initial program 93.3%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in y around inf 79.5%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.8e+116) (not (<= z 6.4e+94))) (- x (/ x (/ z y))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+116) || !(z <= 6.4e+94)) {
tmp = x - (x / (z / y));
} else {
tmp = x * (y / (t - z));
}
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 ((z <= (-3.8d+116)) .or. (.not. (z <= 6.4d+94))) then
tmp = x - (x / (z / y))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+116) || !(z <= 6.4e+94)) {
tmp = x - (x / (z / y));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.8e+116) or not (z <= 6.4e+94): tmp = x - (x / (z / y)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.8e+116) || !(z <= 6.4e+94)) tmp = Float64(x - Float64(x / Float64(z / y))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.8e+116) || ~((z <= 6.4e+94))) tmp = x - (x / (z / y)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.8e+116], N[Not[LessEqual[z, 6.4e+94]], $MachinePrecision]], N[(x - N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+116} \lor \neg \left(z \leq 6.4 \cdot 10^{+94}\right):\\
\;\;\;\;x - \frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -3.7999999999999999e116 or 6.40000000000000028e94 < z Initial program 69.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 88.4%
neg-mul-188.4%
distribute-neg-frac88.4%
Simplified88.4%
Taylor expanded in z around 0 78.4%
+-commutative78.4%
mul-1-neg78.4%
unsub-neg78.4%
associate-*r/83.1%
Simplified83.1%
Taylor expanded in y around 0 78.4%
*-commutative78.4%
associate-/l*88.4%
Simplified88.4%
if -3.7999999999999999e116 < z < 6.40000000000000028e94Initial program 93.3%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in y around inf 79.5%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (<= z -5.7e+131) x (if (<= z 1.8e+99) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.7e+131) {
tmp = x;
} else if (z <= 1.8e+99) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
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 (z <= (-5.7d+131)) then
tmp = x
else if (z <= 1.8d+99) then
tmp = x * (y / (t - z))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.7e+131) {
tmp = x;
} else if (z <= 1.8e+99) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.7e+131: tmp = x elif z <= 1.8e+99: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.7e+131) tmp = x; elseif (z <= 1.8e+99) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.7e+131) tmp = x; elseif (z <= 1.8e+99) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.7e+131], x, If[LessEqual[z, 1.8e+99], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+131}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.7e131 or 1.8000000000000001e99 < z Initial program 67.6%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 73.4%
if -5.7e131 < z < 1.8000000000000001e99Initial program 93.5%
associate-*r/96.1%
Simplified96.1%
Taylor expanded in y around inf 78.9%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.6e-14) x (if (<= z 7.2e+92) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e-14) {
tmp = x;
} else if (z <= 7.2e+92) {
tmp = x * (y / t);
} else {
tmp = x;
}
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 (z <= (-1.6d-14)) then
tmp = x
else if (z <= 7.2d+92) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e-14) {
tmp = x;
} else if (z <= 7.2e+92) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e-14: tmp = x elif z <= 7.2e+92: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e-14) tmp = x; elseif (z <= 7.2e+92) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e-14) tmp = x; elseif (z <= 7.2e+92) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e-14], x, If[LessEqual[z, 7.2e+92], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+92}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.6000000000000001e-14 or 7.2e92 < z Initial program 72.7%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 66.8%
if -1.6000000000000001e-14 < z < 7.2e92Initial program 92.8%
associate-*r/95.7%
Simplified95.7%
Taylor expanded in z around 0 63.7%
Final simplification65.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.4%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in z around inf 34.0%
Final simplification34.0%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2023240
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))