
(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 11 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 81.5%
associate-*r/96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= z -9.5e+81)
x
(if (<= z -7.2e-157)
t_1
(if (<= z 2.8e-235) (* (- y z) (/ x t)) (if (<= z 6.8e+71) t_1 x))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -9.5e+81) {
tmp = x;
} else if (z <= -7.2e-157) {
tmp = t_1;
} else if (z <= 2.8e-235) {
tmp = (y - z) * (x / t);
} else if (z <= 6.8e+71) {
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 <= (-9.5d+81)) then
tmp = x
else if (z <= (-7.2d-157)) then
tmp = t_1
else if (z <= 2.8d-235) then
tmp = (y - z) * (x / t)
else if (z <= 6.8d+71) 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 <= -9.5e+81) {
tmp = x;
} else if (z <= -7.2e-157) {
tmp = t_1;
} else if (z <= 2.8e-235) {
tmp = (y - z) * (x / t);
} else if (z <= 6.8e+71) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if z <= -9.5e+81: tmp = x elif z <= -7.2e-157: tmp = t_1 elif z <= 2.8e-235: tmp = (y - z) * (x / t) elif z <= 6.8e+71: 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 <= -9.5e+81) tmp = x; elseif (z <= -7.2e-157) tmp = t_1; elseif (z <= 2.8e-235) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 6.8e+71) 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 <= -9.5e+81) tmp = x; elseif (z <= -7.2e-157) tmp = t_1; elseif (z <= 2.8e-235) tmp = (y - z) * (x / t); elseif (z <= 6.8e+71) 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, -9.5e+81], x, If[LessEqual[z, -7.2e-157], t$95$1, If[LessEqual[z, 2.8e-235], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+71], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-157}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-235}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.50000000000000083e81 or 6.7999999999999997e71 < z Initial program 61.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.7%
if -9.50000000000000083e81 < z < -7.2e-157 or 2.79999999999999995e-235 < z < 6.7999999999999997e71Initial program 92.7%
associate-*r/97.8%
Simplified97.8%
Taylor expanded in y around inf 77.2%
if -7.2e-157 < z < 2.79999999999999995e-235Initial program 94.7%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around inf 92.3%
Final simplification78.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))) (t_2 (* x (/ z (- z t)))))
(if (<= z -2.5e+30)
t_2
(if (<= z -7e-157)
t_1
(if (<= z 6.3e-235) (* (- y z) (/ x t)) (if (<= z 2.3e+65) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double t_2 = x * (z / (z - t));
double tmp;
if (z <= -2.5e+30) {
tmp = t_2;
} else if (z <= -7e-157) {
tmp = t_1;
} else if (z <= 6.3e-235) {
tmp = (y - z) * (x / t);
} else if (z <= 2.3e+65) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * (y / (t - z))
t_2 = x * (z / (z - t))
if (z <= (-2.5d+30)) then
tmp = t_2
else if (z <= (-7d-157)) then
tmp = t_1
else if (z <= 6.3d-235) then
tmp = (y - z) * (x / t)
else if (z <= 2.3d+65) then
tmp = t_1
else
tmp = t_2
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 t_2 = x * (z / (z - t));
double tmp;
if (z <= -2.5e+30) {
tmp = t_2;
} else if (z <= -7e-157) {
tmp = t_1;
} else if (z <= 6.3e-235) {
tmp = (y - z) * (x / t);
} else if (z <= 2.3e+65) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) t_2 = x * (z / (z - t)) tmp = 0 if z <= -2.5e+30: tmp = t_2 elif z <= -7e-157: tmp = t_1 elif z <= 6.3e-235: tmp = (y - z) * (x / t) elif z <= 2.3e+65: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) t_2 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -2.5e+30) tmp = t_2; elseif (z <= -7e-157) tmp = t_1; elseif (z <= 6.3e-235) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 2.3e+65) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); t_2 = x * (z / (z - t)); tmp = 0.0; if (z <= -2.5e+30) tmp = t_2; elseif (z <= -7e-157) tmp = t_1; elseif (z <= 6.3e-235) tmp = (y - z) * (x / t); elseif (z <= 2.3e+65) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+30], t$95$2, If[LessEqual[z, -7e-157], t$95$1, If[LessEqual[z, 6.3e-235], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+65], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
t_2 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+30}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-157}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{-235}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.4999999999999999e30 or 2.3e65 < z Initial program 62.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 83.5%
associate-*r/83.5%
neg-mul-183.5%
neg-sub083.5%
associate--r-83.5%
neg-sub083.5%
Simplified83.5%
Taylor expanded in x around 0 52.9%
associate-/l*64.0%
associate-/r/83.5%
Simplified83.5%
if -2.4999999999999999e30 < z < -7.0000000000000004e-157 or 6.2999999999999995e-235 < z < 2.3e65Initial program 94.9%
associate-*r/97.6%
Simplified97.6%
Taylor expanded in y around inf 81.7%
if -7.0000000000000004e-157 < z < 6.2999999999999995e-235Initial program 94.7%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around inf 92.3%
Final simplification84.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ (- t z) y))) (t_2 (* x (/ z (- z t)))))
(if (<= z -2.8e+30)
t_2
(if (<= z -1.02e-150)
t_1
(if (<= z 4.4e-235) (* (- y z) (/ x t)) (if (<= z 5.9e+63) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double t_2 = x * (z / (z - t));
double tmp;
if (z <= -2.8e+30) {
tmp = t_2;
} else if (z <= -1.02e-150) {
tmp = t_1;
} else if (z <= 4.4e-235) {
tmp = (y - z) * (x / t);
} else if (z <= 5.9e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x / ((t - z) / y)
t_2 = x * (z / (z - t))
if (z <= (-2.8d+30)) then
tmp = t_2
else if (z <= (-1.02d-150)) then
tmp = t_1
else if (z <= 4.4d-235) then
tmp = (y - z) * (x / t)
else if (z <= 5.9d+63) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double t_2 = x * (z / (z - t));
double tmp;
if (z <= -2.8e+30) {
tmp = t_2;
} else if (z <= -1.02e-150) {
tmp = t_1;
} else if (z <= 4.4e-235) {
tmp = (y - z) * (x / t);
} else if (z <= 5.9e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((t - z) / y) t_2 = x * (z / (z - t)) tmp = 0 if z <= -2.8e+30: tmp = t_2 elif z <= -1.02e-150: tmp = t_1 elif z <= 4.4e-235: tmp = (y - z) * (x / t) elif z <= 5.9e+63: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(t - z) / y)) t_2 = Float64(x * Float64(z / Float64(z - t))) tmp = 0.0 if (z <= -2.8e+30) tmp = t_2; elseif (z <= -1.02e-150) tmp = t_1; elseif (z <= 4.4e-235) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 5.9e+63) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((t - z) / y); t_2 = x * (z / (z - t)); tmp = 0.0; if (z <= -2.8e+30) tmp = t_2; elseif (z <= -1.02e-150) tmp = t_1; elseif (z <= 4.4e-235) tmp = (y - z) * (x / t); elseif (z <= 5.9e+63) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+30], t$95$2, If[LessEqual[z, -1.02e-150], t$95$1, If[LessEqual[z, 4.4e-235], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.9e+63], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{t - z}{y}}\\
t_2 := x \cdot \frac{z}{z - t}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+30}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-150}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-235}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.79999999999999983e30 or 5.90000000000000029e63 < z Initial program 62.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 83.5%
associate-*r/83.5%
neg-mul-183.5%
neg-sub083.5%
associate--r-83.5%
neg-sub083.5%
Simplified83.5%
Taylor expanded in x around 0 52.9%
associate-/l*64.0%
associate-/r/83.5%
Simplified83.5%
if -2.79999999999999983e30 < z < -1.0199999999999999e-150 or 4.39999999999999968e-235 < z < 5.90000000000000029e63Initial program 94.7%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around inf 81.1%
if -1.0199999999999999e-150 < z < 4.39999999999999968e-235Initial program 94.9%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around inf 92.6%
Final simplification84.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.1e+42)
x
(if (<= z 5.4e-172)
(/ (* x y) t)
(if (<= z 2.7e-117)
(/ (* x (- y)) z)
(if (<= z 7e+25) (/ x (/ t y)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.1e+42) {
tmp = x;
} else if (z <= 5.4e-172) {
tmp = (x * y) / t;
} else if (z <= 2.7e-117) {
tmp = (x * -y) / z;
} else if (z <= 7e+25) {
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 <= (-4.1d+42)) then
tmp = x
else if (z <= 5.4d-172) then
tmp = (x * y) / t
else if (z <= 2.7d-117) then
tmp = (x * -y) / z
else if (z <= 7d+25) 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 <= -4.1e+42) {
tmp = x;
} else if (z <= 5.4e-172) {
tmp = (x * y) / t;
} else if (z <= 2.7e-117) {
tmp = (x * -y) / z;
} else if (z <= 7e+25) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.1e+42: tmp = x elif z <= 5.4e-172: tmp = (x * y) / t elif z <= 2.7e-117: tmp = (x * -y) / z elif z <= 7e+25: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.1e+42) tmp = x; elseif (z <= 5.4e-172) tmp = Float64(Float64(x * y) / t); elseif (z <= 2.7e-117) tmp = Float64(Float64(x * Float64(-y)) / z); elseif (z <= 7e+25) 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 <= -4.1e+42) tmp = x; elseif (z <= 5.4e-172) tmp = (x * y) / t; elseif (z <= 2.7e-117) tmp = (x * -y) / z; elseif (z <= 7e+25) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.1e+42], x, If[LessEqual[z, 5.4e-172], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.7e-117], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 7e+25], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-172}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-117}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.1e42 or 6.99999999999999999e25 < z Initial program 63.2%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 68.4%
if -4.1e42 < z < 5.40000000000000051e-172Initial program 96.4%
associate-*r/93.9%
Simplified93.9%
Taylor expanded in z around 0 73.4%
if 5.40000000000000051e-172 < z < 2.70000000000000003e-117Initial program 86.0%
associate-*r/86.2%
Simplified86.2%
Taylor expanded in y around inf 86.0%
Taylor expanded in t around 0 86.0%
associate-*r/86.0%
mul-1-neg86.0%
distribute-rgt-neg-in86.0%
Simplified86.0%
if 2.70000000000000003e-117 < z < 6.99999999999999999e25Initial program 92.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 59.8%
Final simplification70.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.4e+30) (not (<= z 2.6e+34))) (* x (/ z (- z t))) (/ (* x y) (- t z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.4e+30) || !(z <= 2.6e+34)) {
tmp = x * (z / (z - t));
} 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.4d+30)) .or. (.not. (z <= 2.6d+34))) then
tmp = x * (z / (z - t))
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.4e+30) || !(z <= 2.6e+34)) {
tmp = x * (z / (z - t));
} else {
tmp = (x * y) / (t - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.4e+30) or not (z <= 2.6e+34): tmp = x * (z / (z - t)) else: tmp = (x * y) / (t - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.4e+30) || !(z <= 2.6e+34)) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(Float64(x * y) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.4e+30) || ~((z <= 2.6e+34))) tmp = x * (z / (z - t)); else tmp = (x * y) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4e+30], N[Not[LessEqual[z, 2.6e+34]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+30} \lor \neg \left(z \leq 2.6 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\end{array}
\end{array}
if z < -3.4000000000000002e30 or 2.59999999999999997e34 < z Initial program 63.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
neg-sub081.9%
associate--r-81.9%
neg-sub081.9%
Simplified81.9%
Taylor expanded in x around 0 52.9%
associate-/l*62.6%
associate-/r/81.9%
Simplified81.9%
if -3.4000000000000002e30 < z < 2.59999999999999997e34Initial program 95.2%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in y around inf 84.8%
Final simplification83.5%
(FPCore (x y z t) :precision binary64 (if (<= z -6.5e+79) x (if (<= z 1.16e+69) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.5e+79) {
tmp = x;
} else if (z <= 1.16e+69) {
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 <= (-6.5d+79)) then
tmp = x
else if (z <= 1.16d+69) 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 <= -6.5e+79) {
tmp = x;
} else if (z <= 1.16e+69) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.5e+79: tmp = x elif z <= 1.16e+69: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.5e+79) tmp = x; elseif (z <= 1.16e+69) 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 <= -6.5e+79) tmp = x; elseif (z <= 1.16e+69) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.5e+79], x, If[LessEqual[z, 1.16e+69], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+79}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{+69}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.49999999999999954e79 or 1.16000000000000005e69 < z Initial program 61.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.7%
if -6.49999999999999954e79 < z < 1.16000000000000005e69Initial program 93.4%
associate-*r/95.0%
Simplified95.0%
Taylor expanded in y around inf 78.7%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e+29) (* x (/ z (- z t))) (if (<= z 2.4e+31) (/ (* x y) (- t z)) (* x (/ (- z y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+29) {
tmp = x * (z / (z - t));
} else if (z <= 2.4e+31) {
tmp = (x * y) / (t - z);
} else {
tmp = x * ((z - y) / 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 <= (-2.2d+29)) then
tmp = x * (z / (z - t))
else if (z <= 2.4d+31) then
tmp = (x * y) / (t - z)
else
tmp = x * ((z - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+29) {
tmp = x * (z / (z - t));
} else if (z <= 2.4e+31) {
tmp = (x * y) / (t - z);
} else {
tmp = x * ((z - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+29: tmp = x * (z / (z - t)) elif z <= 2.4e+31: tmp = (x * y) / (t - z) else: tmp = x * ((z - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+29) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 2.4e+31) tmp = Float64(Float64(x * y) / Float64(t - z)); else tmp = Float64(x * Float64(Float64(z - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e+29) tmp = x * (z / (z - t)); elseif (z <= 2.4e+31) tmp = (x * y) / (t - z); else tmp = x * ((z - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+29], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+31], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+31}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - y}{z}\\
\end{array}
\end{array}
if z < -2.2000000000000001e29Initial program 55.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 85.5%
associate-*r/85.5%
neg-mul-185.5%
neg-sub085.5%
associate--r-85.5%
neg-sub085.5%
Simplified85.5%
Taylor expanded in x around 0 49.0%
associate-/l*71.9%
associate-/r/85.5%
Simplified85.5%
if -2.2000000000000001e29 < z < 2.39999999999999982e31Initial program 95.2%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in y around inf 84.8%
if 2.39999999999999982e31 < z Initial program 72.3%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in t around 0 84.4%
associate-*r/84.4%
neg-mul-184.4%
neg-sub084.4%
associate--r-84.4%
neg-sub084.4%
Simplified84.4%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (<= z -5.6e+77) x (if (<= z 2e+32) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.6e+77) {
tmp = x;
} else if (z <= 2e+32) {
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 <= (-5.6d+77)) then
tmp = x
else if (z <= 2d+32) 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 <= -5.6e+77) {
tmp = x;
} else if (z <= 2e+32) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.6e+77: tmp = x elif z <= 2e+32: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.6e+77) tmp = x; elseif (z <= 2e+32) 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 <= -5.6e+77) tmp = x; elseif (z <= 2e+32) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.6e+77], x, If[LessEqual[z, 2e+32], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+77}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.60000000000000001e77 or 2.00000000000000011e32 < z Initial program 63.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 70.9%
if -5.60000000000000001e77 < z < 2.00000000000000011e32Initial program 93.7%
associate-*r/94.8%
Simplified94.8%
Taylor expanded in z around 0 65.6%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.9e+43) x (if (<= z 2.8e+25) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e+43) {
tmp = x;
} else if (z <= 2.8e+25) {
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.9d+43)) then
tmp = x
else if (z <= 2.8d+25) 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.9e+43) {
tmp = x;
} else if (z <= 2.8e+25) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.9e+43: tmp = x elif z <= 2.8e+25: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.9e+43) tmp = x; elseif (z <= 2.8e+25) tmp = Float64(Float64(x * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.9e+43) tmp = x; elseif (z <= 2.8e+25) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.9e+43], x, If[LessEqual[z, 2.8e+25], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+43}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.90000000000000004e43 or 2.8000000000000002e25 < z Initial program 63.2%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 68.4%
if -1.90000000000000004e43 < z < 2.8000000000000002e25Initial program 95.3%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in z around 0 67.6%
Final simplification67.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 81.5%
associate-*r/96.9%
Simplified96.9%
Taylor expanded in z around inf 34.3%
Final simplification34.3%
(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 2023238
(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)))