
(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 84.6%
associate-*r/97.0%
Simplified97.0%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= z -2.7e+119)
x
(if (<= z -8.2e-215)
t_1
(if (<= z 3.8e+33)
(* (- y z) (/ x t))
(if (<= z 1.45e+91)
(/ z (/ z x))
(if (or (<= z 6e+126) (and (not (<= z 2.7e+155)) (<= z 6.2e+188)))
t_1
x)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -2.7e+119) {
tmp = x;
} else if (z <= -8.2e-215) {
tmp = t_1;
} else if (z <= 3.8e+33) {
tmp = (y - z) * (x / t);
} else if (z <= 1.45e+91) {
tmp = z / (z / x);
} else if ((z <= 6e+126) || (!(z <= 2.7e+155) && (z <= 6.2e+188))) {
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 <= (-2.7d+119)) then
tmp = x
else if (z <= (-8.2d-215)) then
tmp = t_1
else if (z <= 3.8d+33) then
tmp = (y - z) * (x / t)
else if (z <= 1.45d+91) then
tmp = z / (z / x)
else if ((z <= 6d+126) .or. (.not. (z <= 2.7d+155)) .and. (z <= 6.2d+188)) 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 <= -2.7e+119) {
tmp = x;
} else if (z <= -8.2e-215) {
tmp = t_1;
} else if (z <= 3.8e+33) {
tmp = (y - z) * (x / t);
} else if (z <= 1.45e+91) {
tmp = z / (z / x);
} else if ((z <= 6e+126) || (!(z <= 2.7e+155) && (z <= 6.2e+188))) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if z <= -2.7e+119: tmp = x elif z <= -8.2e-215: tmp = t_1 elif z <= 3.8e+33: tmp = (y - z) * (x / t) elif z <= 1.45e+91: tmp = z / (z / x) elif (z <= 6e+126) or (not (z <= 2.7e+155) and (z <= 6.2e+188)): 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 <= -2.7e+119) tmp = x; elseif (z <= -8.2e-215) tmp = t_1; elseif (z <= 3.8e+33) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 1.45e+91) tmp = Float64(z / Float64(z / x)); elseif ((z <= 6e+126) || (!(z <= 2.7e+155) && (z <= 6.2e+188))) 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 <= -2.7e+119) tmp = x; elseif (z <= -8.2e-215) tmp = t_1; elseif (z <= 3.8e+33) tmp = (y - z) * (x / t); elseif (z <= 1.45e+91) tmp = z / (z / x); elseif ((z <= 6e+126) || (~((z <= 2.7e+155)) && (z <= 6.2e+188))) 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, -2.7e+119], x, If[LessEqual[z, -8.2e-215], t$95$1, If[LessEqual[z, 3.8e+33], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+91], N[(z / N[(z / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6e+126], And[N[Not[LessEqual[z, 2.7e+155]], $MachinePrecision], LessEqual[z, 6.2e+188]]], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+119}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-215}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+33}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+91}:\\
\;\;\;\;\frac{z}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+126} \lor \neg \left(z \leq 2.7 \cdot 10^{+155}\right) \land z \leq 6.2 \cdot 10^{+188}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.6999999999999998e119 or 6.0000000000000005e126 < z < 2.69999999999999994e155 or 6.2000000000000004e188 < z Initial program 72.7%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.2%
if -2.6999999999999998e119 < z < -8.1999999999999997e-215 or 1.45000000000000007e91 < z < 6.0000000000000005e126 or 2.69999999999999994e155 < z < 6.2000000000000004e188Initial program 86.8%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around inf 72.1%
if -8.1999999999999997e-215 < z < 3.80000000000000002e33Initial program 94.3%
associate-*l/92.8%
Simplified92.8%
Taylor expanded in t around inf 78.1%
if 3.80000000000000002e33 < z < 1.45000000000000007e91Initial program 88.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 87.3%
associate-*r/87.3%
neg-mul-187.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.3%
Simplified87.3%
Taylor expanded in x around 0 75.7%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in z around inf 71.6%
Final simplification75.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= z -1.28e+123)
x
(if (<= z -2.7e-213)
t_1
(if (<= z 8.5e+36)
(* (- y z) (/ x t))
(if (<= z 7.2e+89)
(/ z (/ z x))
(if (<= z 6e+126)
t_1
(if (<= z 2.1e+155)
(/ x (+ 1.0 (/ y z)))
(if (<= z 6.2e+188) t_1 x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -1.28e+123) {
tmp = x;
} else if (z <= -2.7e-213) {
tmp = t_1;
} else if (z <= 8.5e+36) {
tmp = (y - z) * (x / t);
} else if (z <= 7.2e+89) {
tmp = z / (z / x);
} else if (z <= 6e+126) {
tmp = t_1;
} else if (z <= 2.1e+155) {
tmp = x / (1.0 + (y / z));
} else if (z <= 6.2e+188) {
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 <= (-1.28d+123)) then
tmp = x
else if (z <= (-2.7d-213)) then
tmp = t_1
else if (z <= 8.5d+36) then
tmp = (y - z) * (x / t)
else if (z <= 7.2d+89) then
tmp = z / (z / x)
else if (z <= 6d+126) then
tmp = t_1
else if (z <= 2.1d+155) then
tmp = x / (1.0d0 + (y / z))
else if (z <= 6.2d+188) 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 <= -1.28e+123) {
tmp = x;
} else if (z <= -2.7e-213) {
tmp = t_1;
} else if (z <= 8.5e+36) {
tmp = (y - z) * (x / t);
} else if (z <= 7.2e+89) {
tmp = z / (z / x);
} else if (z <= 6e+126) {
tmp = t_1;
} else if (z <= 2.1e+155) {
tmp = x / (1.0 + (y / z));
} else if (z <= 6.2e+188) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if z <= -1.28e+123: tmp = x elif z <= -2.7e-213: tmp = t_1 elif z <= 8.5e+36: tmp = (y - z) * (x / t) elif z <= 7.2e+89: tmp = z / (z / x) elif z <= 6e+126: tmp = t_1 elif z <= 2.1e+155: tmp = x / (1.0 + (y / z)) elif z <= 6.2e+188: 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 <= -1.28e+123) tmp = x; elseif (z <= -2.7e-213) tmp = t_1; elseif (z <= 8.5e+36) tmp = Float64(Float64(y - z) * Float64(x / t)); elseif (z <= 7.2e+89) tmp = Float64(z / Float64(z / x)); elseif (z <= 6e+126) tmp = t_1; elseif (z <= 2.1e+155) tmp = Float64(x / Float64(1.0 + Float64(y / z))); elseif (z <= 6.2e+188) 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 <= -1.28e+123) tmp = x; elseif (z <= -2.7e-213) tmp = t_1; elseif (z <= 8.5e+36) tmp = (y - z) * (x / t); elseif (z <= 7.2e+89) tmp = z / (z / x); elseif (z <= 6e+126) tmp = t_1; elseif (z <= 2.1e+155) tmp = x / (1.0 + (y / z)); elseif (z <= 6.2e+188) 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, -1.28e+123], x, If[LessEqual[z, -2.7e-213], t$95$1, If[LessEqual[z, 8.5e+36], N[(N[(y - z), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+89], N[(z / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+126], t$95$1, If[LessEqual[z, 2.1e+155], N[(x / N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+188], t$95$1, x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;z \leq -1.28 \cdot 10^{+123}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-213}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+36}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+89}:\\
\;\;\;\;\frac{z}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{1 + \frac{y}{z}}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+188}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.28000000000000005e123 or 6.2000000000000004e188 < z Initial program 71.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.7%
if -1.28000000000000005e123 < z < -2.7000000000000001e-213 or 7.2e89 < z < 6.0000000000000005e126 or 2.1e155 < z < 6.2000000000000004e188Initial program 86.8%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around inf 72.1%
if -2.7000000000000001e-213 < z < 8.50000000000000014e36Initial program 94.3%
associate-*l/92.8%
Simplified92.8%
Taylor expanded in t around inf 78.1%
if 8.50000000000000014e36 < z < 7.2e89Initial program 88.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 87.3%
associate-*r/87.3%
neg-mul-187.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.3%
Simplified87.3%
Taylor expanded in x around 0 75.7%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in z around inf 71.6%
if 6.0000000000000005e126 < z < 2.1e155Initial program 78.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around 0 78.8%
neg-mul-178.8%
distribute-neg-frac78.8%
Simplified78.8%
Taylor expanded in z around inf 75.0%
Final simplification75.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= z -5.5e+118)
x
(if (<= z 7.9e+34)
t_1
(if (<= z 3.9e+89)
(/ z (/ z x))
(if (or (<= z 6.2e+126) (and (not (<= z 9.5e+154)) (<= z 6.2e+188)))
t_1
x))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -5.5e+118) {
tmp = x;
} else if (z <= 7.9e+34) {
tmp = t_1;
} else if (z <= 3.9e+89) {
tmp = z / (z / x);
} else if ((z <= 6.2e+126) || (!(z <= 9.5e+154) && (z <= 6.2e+188))) {
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 <= (-5.5d+118)) then
tmp = x
else if (z <= 7.9d+34) then
tmp = t_1
else if (z <= 3.9d+89) then
tmp = z / (z / x)
else if ((z <= 6.2d+126) .or. (.not. (z <= 9.5d+154)) .and. (z <= 6.2d+188)) 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 <= -5.5e+118) {
tmp = x;
} else if (z <= 7.9e+34) {
tmp = t_1;
} else if (z <= 3.9e+89) {
tmp = z / (z / x);
} else if ((z <= 6.2e+126) || (!(z <= 9.5e+154) && (z <= 6.2e+188))) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if z <= -5.5e+118: tmp = x elif z <= 7.9e+34: tmp = t_1 elif z <= 3.9e+89: tmp = z / (z / x) elif (z <= 6.2e+126) or (not (z <= 9.5e+154) and (z <= 6.2e+188)): 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 <= -5.5e+118) tmp = x; elseif (z <= 7.9e+34) tmp = t_1; elseif (z <= 3.9e+89) tmp = Float64(z / Float64(z / x)); elseif ((z <= 6.2e+126) || (!(z <= 9.5e+154) && (z <= 6.2e+188))) 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 <= -5.5e+118) tmp = x; elseif (z <= 7.9e+34) tmp = t_1; elseif (z <= 3.9e+89) tmp = z / (z / x); elseif ((z <= 6.2e+126) || (~((z <= 9.5e+154)) && (z <= 6.2e+188))) 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, -5.5e+118], x, If[LessEqual[z, 7.9e+34], t$95$1, If[LessEqual[z, 3.9e+89], N[(z / N[(z / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.2e+126], And[N[Not[LessEqual[z, 9.5e+154]], $MachinePrecision], LessEqual[z, 6.2e+188]]], t$95$1, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+118}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.9 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+89}:\\
\;\;\;\;\frac{z}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+126} \lor \neg \left(z \leq 9.5 \cdot 10^{+154}\right) \land z \leq 6.2 \cdot 10^{+188}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.5000000000000003e118 or 6.2e126 < z < 9.5000000000000001e154 or 6.2000000000000004e188 < z Initial program 72.7%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 76.2%
if -5.5000000000000003e118 < z < 7.89999999999999997e34 or 3.90000000000000011e89 < z < 6.2e126 or 9.5000000000000001e154 < z < 6.2000000000000004e188Initial program 90.8%
associate-*r/95.2%
Simplified95.2%
Taylor expanded in y around inf 71.6%
if 7.89999999999999997e34 < z < 3.90000000000000011e89Initial program 88.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 87.3%
associate-*r/87.3%
neg-mul-187.3%
neg-sub087.3%
associate--r-87.3%
neg-sub087.3%
Simplified87.3%
Taylor expanded in x around 0 75.7%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in z around inf 71.6%
Final simplification73.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.3e+14)
(/ x (- 1.0 (/ t z)))
(if (<= z -1.14e-275)
(/ x (/ (- t z) y))
(if (<= z 8e-83) (/ y (/ (- t z) x)) (- (* x (/ z (- t z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+14) {
tmp = x / (1.0 - (t / z));
} else if (z <= -1.14e-275) {
tmp = x / ((t - z) / y);
} else if (z <= 8e-83) {
tmp = y / ((t - z) / x);
} else {
tmp = -(x * (z / (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 <= (-4.3d+14)) then
tmp = x / (1.0d0 - (t / z))
else if (z <= (-1.14d-275)) then
tmp = x / ((t - z) / y)
else if (z <= 8d-83) then
tmp = y / ((t - z) / x)
else
tmp = -(x * (z / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.3e+14) {
tmp = x / (1.0 - (t / z));
} else if (z <= -1.14e-275) {
tmp = x / ((t - z) / y);
} else if (z <= 8e-83) {
tmp = y / ((t - z) / x);
} else {
tmp = -(x * (z / (t - z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.3e+14: tmp = x / (1.0 - (t / z)) elif z <= -1.14e-275: tmp = x / ((t - z) / y) elif z <= 8e-83: tmp = y / ((t - z) / x) else: tmp = -(x * (z / (t - z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.3e+14) tmp = Float64(x / Float64(1.0 - Float64(t / z))); elseif (z <= -1.14e-275) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (z <= 8e-83) tmp = Float64(y / Float64(Float64(t - z) / x)); else tmp = Float64(-Float64(x * Float64(z / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.3e+14) tmp = x / (1.0 - (t / z)); elseif (z <= -1.14e-275) tmp = x / ((t - z) / y); elseif (z <= 8e-83) tmp = y / ((t - z) / x); else tmp = -(x * (z / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.3e+14], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.14e-275], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-83], N[(y / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], (-N[(x * N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{elif}\;z \leq -1.14 \cdot 10^{-275}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-83}:\\
\;\;\;\;\frac{y}{\frac{t - z}{x}}\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \frac{z}{t - z}\\
\end{array}
\end{array}
if z < -4.3e14Initial program 76.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 79.0%
associate-*r/79.0%
neg-mul-179.0%
neg-sub079.0%
associate--r-79.0%
neg-sub079.0%
Simplified79.0%
Taylor expanded in t around 0 79.1%
mul-1-neg79.1%
unsub-neg79.1%
Simplified79.1%
if -4.3e14 < z < -1.13999999999999995e-275Initial program 91.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 89.0%
if -1.13999999999999995e-275 < z < 8.0000000000000003e-83Initial program 92.4%
associate-/l*86.4%
Simplified86.4%
associate-/l*92.4%
clear-num92.2%
associate-/r/92.2%
Applied egg-rr92.2%
Taylor expanded in y around inf 86.5%
associate-/l*93.9%
Simplified93.9%
if 8.0000000000000003e-83 < z Initial program 82.8%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in y around 0 74.8%
neg-mul-174.8%
distribute-neg-frac74.8%
Simplified74.8%
Final simplification81.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (- 1.0 (/ t z)))))
(if (<= z -4.5e+15)
t_1
(if (<= z -1.45e-276)
(/ x (/ (- t z) y))
(if (<= z 4.5e-82) (/ y (/ (- t z) x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (1.0 - (t / z));
double tmp;
if (z <= -4.5e+15) {
tmp = t_1;
} else if (z <= -1.45e-276) {
tmp = x / ((t - z) / y);
} else if (z <= 4.5e-82) {
tmp = y / ((t - z) / x);
} else {
tmp = t_1;
}
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 / (1.0d0 - (t / z))
if (z <= (-4.5d+15)) then
tmp = t_1
else if (z <= (-1.45d-276)) then
tmp = x / ((t - z) / y)
else if (z <= 4.5d-82) then
tmp = y / ((t - z) / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (1.0 - (t / z));
double tmp;
if (z <= -4.5e+15) {
tmp = t_1;
} else if (z <= -1.45e-276) {
tmp = x / ((t - z) / y);
} else if (z <= 4.5e-82) {
tmp = y / ((t - z) / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (1.0 - (t / z)) tmp = 0 if z <= -4.5e+15: tmp = t_1 elif z <= -1.45e-276: tmp = x / ((t - z) / y) elif z <= 4.5e-82: tmp = y / ((t - z) / x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(1.0 - Float64(t / z))) tmp = 0.0 if (z <= -4.5e+15) tmp = t_1; elseif (z <= -1.45e-276) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (z <= 4.5e-82) tmp = Float64(y / Float64(Float64(t - z) / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (1.0 - (t / z)); tmp = 0.0; if (z <= -4.5e+15) tmp = t_1; elseif (z <= -1.45e-276) tmp = x / ((t - z) / y); elseif (z <= 4.5e-82) tmp = y / ((t - z) / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+15], t$95$1, If[LessEqual[z, -1.45e-276], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-82], N[(y / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - \frac{t}{z}}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-276}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{\frac{t - z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.5e15 or 4.4999999999999998e-82 < z Initial program 80.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 76.3%
associate-*r/76.3%
neg-mul-176.3%
neg-sub076.3%
associate--r-76.3%
neg-sub076.3%
Simplified76.3%
Taylor expanded in t around 0 76.3%
mul-1-neg76.3%
unsub-neg76.3%
Simplified76.3%
if -4.5e15 < z < -1.44999999999999994e-276Initial program 91.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 89.0%
if -1.44999999999999994e-276 < z < 4.4999999999999998e-82Initial program 92.4%
associate-/l*86.4%
Simplified86.4%
associate-/l*92.4%
clear-num92.2%
associate-/r/92.2%
Applied egg-rr92.2%
Taylor expanded in y around inf 86.5%
associate-/l*93.9%
Simplified93.9%
Final simplification81.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5e+14) (not (<= z 2.6e-81))) (/ x (- 1.0 (/ t z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e+14) || !(z <= 2.6e-81)) {
tmp = x / (1.0 - (t / 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 <= (-5d+14)) .or. (.not. (z <= 2.6d-81))) then
tmp = x / (1.0d0 - (t / 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 <= -5e+14) || !(z <= 2.6e-81)) {
tmp = x / (1.0 - (t / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5e+14) or not (z <= 2.6e-81): tmp = x / (1.0 - (t / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5e+14) || !(z <= 2.6e-81)) tmp = Float64(x / Float64(1.0 - Float64(t / 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 <= -5e+14) || ~((z <= 2.6e-81))) tmp = x / (1.0 - (t / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5e+14], N[Not[LessEqual[z, 2.6e-81]], $MachinePrecision]], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+14} \lor \neg \left(z \leq 2.6 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -5e14 or 2.5999999999999999e-81 < z Initial program 80.2%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 76.7%
associate-*r/76.7%
neg-mul-176.7%
neg-sub076.7%
associate--r-76.7%
neg-sub076.7%
Simplified76.7%
Taylor expanded in t around 0 76.8%
mul-1-neg76.8%
unsub-neg76.8%
Simplified76.8%
if -5e14 < z < 2.5999999999999999e-81Initial program 92.0%
associate-*r/93.2%
Simplified93.2%
Taylor expanded in y around inf 86.1%
Final simplification80.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.2e-94) x (if (<= z 1.85e-127) (* z (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e-94) {
tmp = x;
} else if (z <= 1.85e-127) {
tmp = z * (x / 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.2d-94)) then
tmp = x
else if (z <= 1.85d-127) then
tmp = z * (x / 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.2e-94) {
tmp = x;
} else if (z <= 1.85e-127) {
tmp = z * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.2e-94: tmp = x elif z <= 1.85e-127: tmp = z * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.2e-94) tmp = x; elseif (z <= 1.85e-127) tmp = Float64(z * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.2e-94) tmp = x; elseif (z <= 1.85e-127) tmp = z * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.2e-94], x, If[LessEqual[z, 1.85e-127], N[(z * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-94}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-127}:\\
\;\;\;\;z \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.2e-94 or 1.8500000000000002e-127 < z Initial program 80.6%
associate-*r/98.8%
Simplified98.8%
Taylor expanded in z around inf 50.1%
if -1.2e-94 < z < 1.8500000000000002e-127Initial program 94.8%
associate-*l/92.4%
Simplified92.4%
Taylor expanded in t around inf 79.6%
Taylor expanded in y around 0 27.6%
associate-*r/29.1%
associate-*l*29.1%
neg-mul-129.1%
*-commutative29.1%
Simplified29.1%
expm1-log1p-u28.9%
expm1-udef24.5%
add-sqr-sqrt15.1%
sqrt-unprod22.3%
sqr-neg22.3%
sqrt-unprod12.3%
add-sqr-sqrt23.2%
*-commutative23.2%
Applied egg-rr23.2%
expm1-def23.2%
expm1-log1p30.7%
Simplified30.7%
Final simplification44.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.2e+14) x (if (<= z 9.5e-81) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.2e+14) {
tmp = x;
} else if (z <= 9.5e-81) {
tmp = y * (x / 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 <= (-3.2d+14)) then
tmp = x
else if (z <= 9.5d-81) then
tmp = y * (x / 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 <= -3.2e+14) {
tmp = x;
} else if (z <= 9.5e-81) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.2e+14: tmp = x elif z <= 9.5e-81: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.2e+14) tmp = x; elseif (z <= 9.5e-81) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.2e+14) tmp = x; elseif (z <= 9.5e-81) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.2e+14], x, If[LessEqual[z, 9.5e-81], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-81}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.2e14 or 9.49999999999999917e-81 < z Initial program 79.8%
associate-*r/99.2%
Simplified99.2%
Taylor expanded in z around inf 55.5%
if -3.2e14 < z < 9.49999999999999917e-81Initial program 92.9%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in z around 0 72.7%
associate-/r/71.6%
Applied egg-rr71.6%
Final simplification61.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.75e+112) x (if (<= z 2.1e+30) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.75e+112) {
tmp = x;
} else if (z <= 2.1e+30) {
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 <= (-1.75d+112)) then
tmp = x
else if (z <= 2.1d+30) 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 <= -1.75e+112) {
tmp = x;
} else if (z <= 2.1e+30) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.75e+112: tmp = x elif z <= 2.1e+30: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.75e+112) tmp = x; elseif (z <= 2.1e+30) 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 <= -1.75e+112) tmp = x; elseif (z <= 2.1e+30) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.75e+112], x, If[LessEqual[z, 2.1e+30], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+112}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.74999999999999998e112 or 2.1e30 < z Initial program 76.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around inf 63.3%
if -1.74999999999999998e112 < z < 2.1e30Initial program 92.1%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around 0 61.2%
Final simplification62.2%
(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.6%
associate-*r/97.0%
Simplified97.0%
Taylor expanded in z around inf 37.1%
Final simplification37.1%
(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 2023196
(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)))