
(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 10 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.9%
*-commutative84.9%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= z -6e+75)
x
(if (<= z 9.8e-107)
t_1
(if (<= z 1.12e-13) (* (- y z) (/ x t)) (if (<= z 7.1e+142) t_1 x))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -6e+75) {
tmp = x;
} else if (z <= 9.8e-107) {
tmp = t_1;
} else if (z <= 1.12e-13) {
tmp = (y - z) * (x / t);
} else if (z <= 7.1e+142) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (y / (t - z))
if (z <= (-6d+75)) then
tmp = x
else if (z <= 9.8d-107) then
tmp = t_1
else if (z <= 1.12d-13) then
tmp = (y - z) * (x / t)
else if (z <= 7.1d+142) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -6e+75) {
tmp = x;
} else if (z <= 9.8e-107) {
tmp = t_1;
} else if (z <= 1.12e-13) {
tmp = (y - z) * (x / t);
} else if (z <= 7.1e+142) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if z <= -6e+75: tmp = x elif z <= 9.8e-107: tmp = t_1 elif z <= 1.12e-13: tmp = (y - z) * (x / t) elif z <= 7.1e+142: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (z <= -6e+75) tmp = x; elseif (z <= 9.8e-107) tmp = t_1; elseif (z <= 1.12e-13) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 7.1e+142) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (z <= -6e+75) tmp = x; elseif (z <= 9.8e-107) tmp = t_1; elseif (z <= 1.12e-13) tmp = (y - z) * (x / t); elseif (z <= 7.1e+142) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+75], x, If[LessEqual[z, 9.8e-107], t$95$1, If[LessEqual[z, 1.12e-13], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.1e+142], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+75}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-13}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 7.1 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6e75 or 7.1e142 < z Initial program 66.5%
*-commutative66.5%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 71.3%
if -6e75 < z < 9.79999999999999959e-107 or 1.12e-13 < z < 7.1e142Initial program 94.5%
*-commutative94.5%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in y around inf 78.0%
if 9.79999999999999959e-107 < z < 1.12e-13Initial program 99.8%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in t around inf 79.3%
Final simplification75.7%
(FPCore (x y z t) :precision binary64 (if (<= z -2.7e+87) x (if (<= z -0.023) (/ (* x (- y)) z) (if (<= z 2.1e+118) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.7e+87) {
tmp = x;
} else if (z <= -0.023) {
tmp = (x * -y) / z;
} else if (z <= 2.1e+118) {
tmp = x / (t / 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 <= (-2.7d+87)) then
tmp = x
else if (z <= (-0.023d0)) then
tmp = (x * -y) / z
else if (z <= 2.1d+118) then
tmp = x / (t / 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 <= -2.7e+87) {
tmp = x;
} else if (z <= -0.023) {
tmp = (x * -y) / z;
} else if (z <= 2.1e+118) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.7e+87: tmp = x elif z <= -0.023: tmp = (x * -y) / z elif z <= 2.1e+118: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.7e+87) tmp = x; elseif (z <= -0.023) tmp = Float64(Float64(x * Float64(-y)) / z); elseif (z <= 2.1e+118) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.7e+87) tmp = x; elseif (z <= -0.023) tmp = (x * -y) / z; elseif (z <= 2.1e+118) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+87], x, If[LessEqual[z, -0.023], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.1e+118], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -0.023:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+118}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.70000000000000007e87 or 2.1e118 < z Initial program 66.3%
*-commutative66.3%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 70.9%
if -2.70000000000000007e87 < z < -0.023Initial program 99.6%
*-commutative99.6%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 53.2%
Taylor expanded in t around 0 44.9%
mul-1-neg44.9%
Simplified44.9%
if -0.023 < z < 2.1e118Initial program 94.9%
*-commutative94.9%
associate-*l/95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in z around 0 67.0%
associate-/l*68.9%
Simplified68.9%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.8e+24) (not (<= y 1.02e-56))) (* x (/ y (- t z))) (* z (/ x (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e+24) || !(y <= 1.02e-56)) {
tmp = x * (y / (t - z));
} else {
tmp = z * (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 ((y <= (-3.8d+24)) .or. (.not. (y <= 1.02d-56))) then
tmp = x * (y / (t - z))
else
tmp = z * (x / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e+24) || !(y <= 1.02e-56)) {
tmp = x * (y / (t - z));
} else {
tmp = z * (x / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.8e+24) or not (y <= 1.02e-56): tmp = x * (y / (t - z)) else: tmp = z * (x / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.8e+24) || !(y <= 1.02e-56)) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(z * Float64(x / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.8e+24) || ~((y <= 1.02e-56))) tmp = x * (y / (t - z)); else tmp = z * (x / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.8e+24], N[Not[LessEqual[y, 1.02e-56]], $MachinePrecision]], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+24} \lor \neg \left(y \leq 1.02 \cdot 10^{-56}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if y < -3.80000000000000015e24 or 1.02e-56 < y Initial program 86.7%
*-commutative86.7%
associate-*l/98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in y around inf 76.2%
if -3.80000000000000015e24 < y < 1.02e-56Initial program 82.9%
*-commutative82.9%
associate-*l/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 67.7%
associate-*r/67.7%
mul-1-neg67.7%
distribute-rgt-neg-out67.7%
associate-*l/79.2%
Simplified79.2%
associate-*l/67.7%
frac-2neg67.7%
add-sqr-sqrt35.4%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod10.3%
add-sqr-sqrt17.4%
distribute-rgt-neg-out17.4%
add-sqr-sqrt7.1%
sqrt-unprod33.2%
sqr-neg33.2%
sqrt-unprod32.0%
add-sqr-sqrt67.7%
sub-neg67.7%
distribute-neg-in67.7%
add-sqr-sqrt35.5%
sqrt-unprod43.9%
sqr-neg43.9%
sqrt-unprod19.2%
add-sqr-sqrt36.9%
add-sqr-sqrt17.7%
sqrt-unprod43.1%
sqr-neg43.1%
Applied egg-rr67.7%
associate-/l*81.4%
+-commutative81.4%
unsub-neg81.4%
Simplified81.4%
associate-/r/79.2%
Applied egg-rr79.2%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e+24) (not (<= y 3.2e-52))) (* x (/ y (- t z))) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+24) || !(y <= 3.2e-52)) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (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 ((y <= (-4d+24)) .or. (.not. (y <= 3.2d-52))) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e+24) || !(y <= 3.2e-52)) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4e+24) or not (y <= 3.2e-52): tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4e+24) || !(y <= 3.2e-52)) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4e+24) || ~((y <= 3.2e-52))) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4e+24], N[Not[LessEqual[y, 3.2e-52]], $MachinePrecision]], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+24} \lor \neg \left(y \leq 3.2 \cdot 10^{-52}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -3.9999999999999999e24 or 3.2000000000000001e-52 < y Initial program 86.7%
*-commutative86.7%
associate-*l/98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in y around inf 76.2%
if -3.9999999999999999e24 < y < 3.2000000000000001e-52Initial program 82.9%
*-commutative82.9%
associate-*l/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 67.7%
associate-*r/67.7%
mul-1-neg67.7%
distribute-rgt-neg-out67.7%
associate-*l/79.2%
Simplified79.2%
associate-*l/67.7%
frac-2neg67.7%
add-sqr-sqrt35.4%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod10.3%
add-sqr-sqrt17.4%
distribute-rgt-neg-out17.4%
add-sqr-sqrt7.1%
sqrt-unprod33.2%
sqr-neg33.2%
sqrt-unprod32.0%
add-sqr-sqrt67.7%
sub-neg67.7%
distribute-neg-in67.7%
add-sqr-sqrt35.5%
sqrt-unprod43.9%
sqr-neg43.9%
sqrt-unprod19.2%
add-sqr-sqrt36.9%
add-sqr-sqrt17.7%
sqrt-unprod43.1%
sqr-neg43.1%
Applied egg-rr67.7%
associate-/l*81.4%
+-commutative81.4%
unsub-neg81.4%
Simplified81.4%
clear-num80.6%
associate-/r/81.4%
clear-num81.8%
Applied egg-rr81.8%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (<= z -1.06e+83) x (if (<= z 1.95e+144) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e+83) {
tmp = x;
} else if (z <= 1.95e+144) {
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 <= (-1.06d+83)) then
tmp = x
else if (z <= 1.95d+144) 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 <= -1.06e+83) {
tmp = x;
} else if (z <= 1.95e+144) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.06e+83: tmp = x elif z <= 1.95e+144: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.06e+83) tmp = x; elseif (z <= 1.95e+144) 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 <= -1.06e+83) tmp = x; elseif (z <= 1.95e+144) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.06e+83], x, If[LessEqual[z, 1.95e+144], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+144}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.05999999999999995e83 or 1.95000000000000009e144 < z Initial program 66.5%
*-commutative66.5%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 71.3%
if -1.05999999999999995e83 < z < 1.95000000000000009e144Initial program 94.9%
*-commutative94.9%
associate-*l/96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y around inf 75.5%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.22e+26) (* x (/ y (- t z))) (if (<= y 1.8e-52) (* x (/ z (- z t))) (/ x (/ (- t z) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e+26) {
tmp = x * (y / (t - z));
} else if (y <= 1.8e-52) {
tmp = x * (z / (z - t));
} else {
tmp = x / ((t - z) / y);
}
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 (y <= (-1.22d+26)) then
tmp = x * (y / (t - z))
else if (y <= 1.8d-52) then
tmp = x * (z / (z - t))
else
tmp = x / ((t - z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e+26) {
tmp = x * (y / (t - z));
} else if (y <= 1.8e-52) {
tmp = x * (z / (z - t));
} else {
tmp = x / ((t - z) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.22e+26: tmp = x * (y / (t - z)) elif y <= 1.8e-52: tmp = x * (z / (z - t)) else: tmp = x / ((t - z) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.22e+26) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (y <= 1.8e-52) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(x / Float64(Float64(t - z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.22e+26) tmp = x * (y / (t - z)); elseif (y <= 1.8e-52) tmp = x * (z / (z - t)); else tmp = x / ((t - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.22e+26], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-52], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+26}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-52}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\end{array}
\end{array}
if y < -1.2200000000000001e26Initial program 87.0%
*-commutative87.0%
associate-*l/98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in y around inf 77.7%
if -1.2200000000000001e26 < y < 1.79999999999999994e-52Initial program 82.9%
*-commutative82.9%
associate-*l/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 67.7%
associate-*r/67.7%
mul-1-neg67.7%
distribute-rgt-neg-out67.7%
associate-*l/79.2%
Simplified79.2%
associate-*l/67.7%
frac-2neg67.7%
add-sqr-sqrt35.4%
sqrt-unprod35.2%
sqr-neg35.2%
sqrt-unprod10.3%
add-sqr-sqrt17.4%
distribute-rgt-neg-out17.4%
add-sqr-sqrt7.1%
sqrt-unprod33.2%
sqr-neg33.2%
sqrt-unprod32.0%
add-sqr-sqrt67.7%
sub-neg67.7%
distribute-neg-in67.7%
add-sqr-sqrt35.5%
sqrt-unprod43.9%
sqr-neg43.9%
sqrt-unprod19.2%
add-sqr-sqrt36.9%
add-sqr-sqrt17.7%
sqrt-unprod43.1%
sqr-neg43.1%
Applied egg-rr67.7%
associate-/l*81.4%
+-commutative81.4%
unsub-neg81.4%
Simplified81.4%
clear-num80.6%
associate-/r/81.4%
clear-num81.8%
Applied egg-rr81.8%
if 1.79999999999999994e-52 < y Initial program 86.5%
*-commutative86.5%
associate-*l/98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in y around inf 69.3%
associate-/l*76.1%
Simplified76.1%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (<= z -0.0295) x (if (<= z 2.1e+118) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0295) {
tmp = x;
} else if (z <= 2.1e+118) {
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 <= (-0.0295d0)) then
tmp = x
else if (z <= 2.1d+118) 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 <= -0.0295) {
tmp = x;
} else if (z <= 2.1e+118) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.0295: tmp = x elif z <= 2.1e+118: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.0295) tmp = x; elseif (z <= 2.1e+118) 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 <= -0.0295) tmp = x; elseif (z <= 2.1e+118) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.0295], x, If[LessEqual[z, 2.1e+118], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0295:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.029499999999999998 or 2.1e118 < z Initial program 72.0%
*-commutative72.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 62.1%
if -0.029499999999999998 < z < 2.1e118Initial program 94.9%
*-commutative94.9%
associate-*l/95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in z around 0 68.4%
Final simplification65.7%
(FPCore (x y z t) :precision binary64 (if (<= z -0.000102) x (if (<= z 3.6e+118) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.000102) {
tmp = x;
} else if (z <= 3.6e+118) {
tmp = x / (t / 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 <= (-0.000102d0)) then
tmp = x
else if (z <= 3.6d+118) then
tmp = x / (t / 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 <= -0.000102) {
tmp = x;
} else if (z <= 3.6e+118) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.000102: tmp = x elif z <= 3.6e+118: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.000102) tmp = x; elseif (z <= 3.6e+118) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.000102) tmp = x; elseif (z <= 3.6e+118) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.000102], x, If[LessEqual[z, 3.6e+118], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.000102:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+118}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.01999999999999999e-4 or 3.6e118 < z Initial program 72.0%
*-commutative72.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 62.1%
if -1.01999999999999999e-4 < z < 3.6e118Initial program 94.9%
*-commutative94.9%
associate-*l/95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in z around 0 67.0%
associate-/l*68.9%
Simplified68.9%
Final simplification65.9%
(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.9%
*-commutative84.9%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in z around inf 32.9%
Final simplification32.9%
(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 2024020
(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)))