
(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 14 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 (/ (- 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}
Initial program 85.5%
associate-/l*97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (/ z t)))))
(if (<= z -1850000.0)
x
(if (<= z -2.3e-39)
t_1
(if (<= z -2.5e-92)
(/ x (/ t y))
(if (<= z -7.2e-111)
t_1
(if (<= z 8500000000.0) (* x (/ y t)) x)))))))
double code(double x, double y, double z, double t) {
double t_1 = -(x * (z / t));
double tmp;
if (z <= -1850000.0) {
tmp = x;
} else if (z <= -2.3e-39) {
tmp = t_1;
} else if (z <= -2.5e-92) {
tmp = x / (t / y);
} else if (z <= -7.2e-111) {
tmp = t_1;
} else if (z <= 8500000000.0) {
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) :: t_1
real(8) :: tmp
t_1 = -(x * (z / t))
if (z <= (-1850000.0d0)) then
tmp = x
else if (z <= (-2.3d-39)) then
tmp = t_1
else if (z <= (-2.5d-92)) then
tmp = x / (t / y)
else if (z <= (-7.2d-111)) then
tmp = t_1
else if (z <= 8500000000.0d0) 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 t_1 = -(x * (z / t));
double tmp;
if (z <= -1850000.0) {
tmp = x;
} else if (z <= -2.3e-39) {
tmp = t_1;
} else if (z <= -2.5e-92) {
tmp = x / (t / y);
} else if (z <= -7.2e-111) {
tmp = t_1;
} else if (z <= 8500000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = -(x * (z / t)) tmp = 0 if z <= -1850000.0: tmp = x elif z <= -2.3e-39: tmp = t_1 elif z <= -2.5e-92: tmp = x / (t / y) elif z <= -7.2e-111: tmp = t_1 elif z <= 8500000000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(-Float64(x * Float64(z / t))) tmp = 0.0 if (z <= -1850000.0) tmp = x; elseif (z <= -2.3e-39) tmp = t_1; elseif (z <= -2.5e-92) tmp = Float64(x / Float64(t / y)); elseif (z <= -7.2e-111) tmp = t_1; elseif (z <= 8500000000.0) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -(x * (z / t)); tmp = 0.0; if (z <= -1850000.0) tmp = x; elseif (z <= -2.3e-39) tmp = t_1; elseif (z <= -2.5e-92) tmp = x / (t / y); elseif (z <= -7.2e-111) tmp = t_1; elseif (z <= 8500000000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = (-N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[z, -1850000.0], x, If[LessEqual[z, -2.3e-39], t$95$1, If[LessEqual[z, -2.5e-92], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-111], t$95$1, If[LessEqual[z, 8500000000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -x \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -1850000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8500000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.85e6 or 8.5e9 < z Initial program 78.2%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 64.0%
if -1.85e6 < z < -2.30000000000000008e-39 or -2.50000000000000006e-92 < z < -7.20000000000000019e-111Initial program 99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around 0 62.0%
neg-mul-162.0%
distribute-neg-frac62.0%
Simplified62.0%
Taylor expanded in z around 0 61.6%
neg-mul-161.6%
distribute-neg-frac61.6%
Simplified61.6%
if -2.30000000000000008e-39 < z < -2.50000000000000006e-92Initial program 86.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 57.8%
if -7.20000000000000019e-111 < z < 8.5e9Initial program 94.0%
associate-*r/93.3%
Simplified93.3%
Taylor expanded in z around 0 65.1%
Final simplification64.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -440000.0)
x
(if (<= z -2.3e-39)
(/ (* x z) (- t))
(if (<= z -2e-93)
(/ x (/ t y))
(if (<= z -3.1e-108)
(- (* x (/ z t)))
(if (<= z 122000000.0) (* x (/ y t)) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -440000.0) {
tmp = x;
} else if (z <= -2.3e-39) {
tmp = (x * z) / -t;
} else if (z <= -2e-93) {
tmp = x / (t / y);
} else if (z <= -3.1e-108) {
tmp = -(x * (z / t));
} else if (z <= 122000000.0) {
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 <= (-440000.0d0)) then
tmp = x
else if (z <= (-2.3d-39)) then
tmp = (x * z) / -t
else if (z <= (-2d-93)) then
tmp = x / (t / y)
else if (z <= (-3.1d-108)) then
tmp = -(x * (z / t))
else if (z <= 122000000.0d0) 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 <= -440000.0) {
tmp = x;
} else if (z <= -2.3e-39) {
tmp = (x * z) / -t;
} else if (z <= -2e-93) {
tmp = x / (t / y);
} else if (z <= -3.1e-108) {
tmp = -(x * (z / t));
} else if (z <= 122000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -440000.0: tmp = x elif z <= -2.3e-39: tmp = (x * z) / -t elif z <= -2e-93: tmp = x / (t / y) elif z <= -3.1e-108: tmp = -(x * (z / t)) elif z <= 122000000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -440000.0) tmp = x; elseif (z <= -2.3e-39) tmp = Float64(Float64(x * z) / Float64(-t)); elseif (z <= -2e-93) tmp = Float64(x / Float64(t / y)); elseif (z <= -3.1e-108) tmp = Float64(-Float64(x * Float64(z / t))); elseif (z <= 122000000.0) 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 <= -440000.0) tmp = x; elseif (z <= -2.3e-39) tmp = (x * z) / -t; elseif (z <= -2e-93) tmp = x / (t / y); elseif (z <= -3.1e-108) tmp = -(x * (z / t)); elseif (z <= 122000000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -440000.0], x, If[LessEqual[z, -2.3e-39], N[(N[(x * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, -2e-93], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e-108], (-N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), If[LessEqual[z, 122000000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -440000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-39}:\\
\;\;\;\;\frac{x \cdot z}{-t}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-93}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-108}:\\
\;\;\;\;-x \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 122000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4e5 or 1.22e8 < z Initial program 78.2%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 64.0%
if -4.4e5 < z < -2.30000000000000008e-39Initial program 99.7%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in y around 0 60.9%
neg-mul-160.9%
distribute-neg-frac60.9%
Simplified60.9%
Taylor expanded in z around 0 52.0%
neg-mul-152.0%
distribute-neg-frac52.0%
Simplified52.0%
*-commutative52.0%
frac-2neg52.0%
remove-double-neg52.0%
associate-*l/52.1%
Applied egg-rr52.1%
if -2.30000000000000008e-39 < z < -1.9999999999999998e-93Initial program 86.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 57.8%
if -1.9999999999999998e-93 < z < -3.10000000000000014e-108Initial program 99.5%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around 0 66.7%
neg-mul-166.7%
distribute-neg-frac66.7%
Simplified66.7%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
distribute-neg-frac100.0%
Simplified100.0%
if -3.10000000000000014e-108 < z < 1.22e8Initial program 94.0%
associate-*r/93.3%
Simplified93.3%
Taylor expanded in z around 0 65.1%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e-14) (not (<= z 16000000.0))) (* x (/ z (- z t))) (* x (/ (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-14) || !(z <= 16000000.0)) {
tmp = x * (z / (z - t));
} else {
tmp = x * ((y - 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 ((z <= (-7.2d-14)) .or. (.not. (z <= 16000000.0d0))) then
tmp = x * (z / (z - t))
else
tmp = x * ((y - z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-14) || !(z <= 16000000.0)) {
tmp = x * (z / (z - t));
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e-14) or not (z <= 16000000.0): tmp = x * (z / (z - t)) else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.2e-14) || !(z <= 16000000.0)) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = Float64(x * Float64(Float64(y - z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.2e-14) || ~((z <= 16000000.0))) tmp = x * (z / (z - t)); else tmp = x * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e-14], N[Not[LessEqual[z, 16000000.0]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-14} \lor \neg \left(z \leq 16000000\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if z < -7.1999999999999996e-14 or 1.6e7 < z Initial program 78.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 77.9%
neg-mul-177.9%
distribute-neg-frac77.9%
Simplified77.9%
distribute-frac-neg77.9%
frac-2neg77.9%
distribute-frac-neg77.9%
remove-double-neg77.9%
associate-*r/60.2%
sub-neg60.2%
distribute-neg-in60.2%
remove-double-neg60.2%
Applied egg-rr60.2%
*-commutative60.2%
associate-/l*58.4%
associate-/r/77.9%
+-commutative77.9%
unsub-neg77.9%
Simplified77.9%
if -7.1999999999999996e-14 < z < 1.6e7Initial program 93.9%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in t around inf 76.3%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.8e+32) (not (<= y 4.2e+70))) (/ x (/ (- t z) y)) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.8e+32) || !(y <= 4.2e+70)) {
tmp = x / ((t - z) / y);
} 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 <= (-8.8d+32)) .or. (.not. (y <= 4.2d+70))) then
tmp = x / ((t - z) / y)
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 <= -8.8e+32) || !(y <= 4.2e+70)) {
tmp = x / ((t - z) / y);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.8e+32) or not (y <= 4.2e+70): tmp = x / ((t - z) / y) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.8e+32) || !(y <= 4.2e+70)) tmp = Float64(x / Float64(Float64(t - z) / y)); 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 <= -8.8e+32) || ~((y <= 4.2e+70))) tmp = x / ((t - z) / y); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.8e+32], N[Not[LessEqual[y, 4.2e+70]], $MachinePrecision]], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+32} \lor \neg \left(y \leq 4.2 \cdot 10^{+70}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -8.80000000000000004e32 or 4.20000000000000015e70 < y Initial program 86.7%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in y around inf 75.6%
if -8.80000000000000004e32 < y < 4.20000000000000015e70Initial program 84.9%
associate-*r/97.8%
Simplified97.8%
Taylor expanded in y around 0 82.2%
neg-mul-182.2%
distribute-neg-frac82.2%
Simplified82.2%
distribute-frac-neg82.2%
frac-2neg82.2%
distribute-frac-neg82.2%
remove-double-neg82.2%
associate-*r/68.4%
sub-neg68.4%
distribute-neg-in68.4%
remove-double-neg68.4%
Applied egg-rr68.4%
*-commutative68.4%
associate-/l*70.7%
associate-/r/82.2%
+-commutative82.2%
unsub-neg82.2%
Simplified82.2%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (<= z -44000000.0) x (if (<= z 28500000000.0) (* x (/ (- y z) t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -44000000.0) {
tmp = x;
} else if (z <= 28500000000.0) {
tmp = x * ((y - z) / 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 <= (-44000000.0d0)) then
tmp = x
else if (z <= 28500000000.0d0) then
tmp = x * ((y - z) / 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 <= -44000000.0) {
tmp = x;
} else if (z <= 28500000000.0) {
tmp = x * ((y - z) / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -44000000.0: tmp = x elif z <= 28500000000.0: tmp = x * ((y - z) / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -44000000.0) tmp = x; elseif (z <= 28500000000.0) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -44000000.0) tmp = x; elseif (z <= 28500000000.0) tmp = x * ((y - z) / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -44000000.0], x, If[LessEqual[z, 28500000000.0], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -44000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 28500000000:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4e7 or 2.85e10 < z Initial program 78.2%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 64.0%
if -4.4e7 < z < 2.85e10Initial program 94.1%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in t around inf 74.8%
Final simplification69.0%
(FPCore (x y z t) :precision binary64 (if (<= z -3.5e-14) (* x (/ z (- z t))) (if (<= z 1200000000.0) (* x (/ (- y z) t)) (- x (* y (/ x z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-14) {
tmp = x * (z / (z - t));
} else if (z <= 1200000000.0) {
tmp = x * ((y - z) / t);
} else {
tmp = x - (y * (x / 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.5d-14)) then
tmp = x * (z / (z - t))
else if (z <= 1200000000.0d0) then
tmp = x * ((y - z) / t)
else
tmp = x - (y * (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-14) {
tmp = x * (z / (z - t));
} else if (z <= 1200000000.0) {
tmp = x * ((y - z) / t);
} else {
tmp = x - (y * (x / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.5e-14: tmp = x * (z / (z - t)) elif z <= 1200000000.0: tmp = x * ((y - z) / t) else: tmp = x - (y * (x / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e-14) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 1200000000.0) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = Float64(x - Float64(y * Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.5e-14) tmp = x * (z / (z - t)); elseif (z <= 1200000000.0) tmp = x * ((y - z) / t); else tmp = x - (y * (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e-14], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1200000000.0], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 1200000000:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -3.5000000000000002e-14Initial program 82.9%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
neg-mul-183.8%
distribute-neg-frac83.8%
Simplified83.8%
distribute-frac-neg83.8%
frac-2neg83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
associate-*r/68.2%
sub-neg68.2%
distribute-neg-in68.2%
remove-double-neg68.2%
Applied egg-rr68.2%
*-commutative68.2%
associate-/l*58.9%
associate-/r/83.8%
+-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if -3.5000000000000002e-14 < z < 1.2e9Initial program 94.0%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in t around inf 75.8%
if 1.2e9 < z Initial program 74.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 56.9%
mul-1-neg56.9%
associate-/l*65.3%
distribute-neg-frac65.3%
neg-sub065.3%
associate--r-65.3%
neg-sub065.3%
Simplified65.3%
Taylor expanded in y around 0 70.1%
+-commutative70.1%
mul-1-neg70.1%
unsub-neg70.1%
associate-*r/76.2%
Simplified76.2%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e-14) (* x (/ z (- z t))) (if (<= z 1400000000.0) (* x (/ (- y z) t)) (- x (/ y (/ z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-14) {
tmp = x * (z / (z - t));
} else if (z <= 1400000000.0) {
tmp = x * ((y - z) / t);
} else {
tmp = x - (y / (z / 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.2d-14)) then
tmp = x * (z / (z - t))
else if (z <= 1400000000.0d0) then
tmp = x * ((y - z) / t)
else
tmp = x - (y / (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-14) {
tmp = x * (z / (z - t));
} else if (z <= 1400000000.0) {
tmp = x * ((y - z) / t);
} else {
tmp = x - (y / (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e-14: tmp = x * (z / (z - t)) elif z <= 1400000000.0: tmp = x * ((y - z) / t) else: tmp = x - (y / (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e-14) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 1400000000.0) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = Float64(x - Float64(y / Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e-14) tmp = x * (z / (z - t)); elseif (z <= 1400000000.0) tmp = x * ((y - z) / t); else tmp = x - (y / (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e-14], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1400000000.0], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 1400000000:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -5.19999999999999993e-14Initial program 82.9%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
neg-mul-183.8%
distribute-neg-frac83.8%
Simplified83.8%
distribute-frac-neg83.8%
frac-2neg83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
associate-*r/68.2%
sub-neg68.2%
distribute-neg-in68.2%
remove-double-neg68.2%
Applied egg-rr68.2%
*-commutative68.2%
associate-/l*58.9%
associate-/r/83.8%
+-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if -5.19999999999999993e-14 < z < 1.4e9Initial program 94.0%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in t around inf 75.8%
if 1.4e9 < z Initial program 74.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 56.9%
mul-1-neg56.9%
associate-/l*65.3%
distribute-neg-frac65.3%
neg-sub065.3%
associate--r-65.3%
neg-sub065.3%
Simplified65.3%
Taylor expanded in y around 0 70.1%
+-commutative70.1%
mul-1-neg70.1%
unsub-neg70.1%
associate-*r/76.2%
Simplified76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (if (<= z -6e-14) (* x (/ z (- z t))) (if (<= z 920000000.0) (/ x (/ t (- y z))) (- x (/ y (/ z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6e-14) {
tmp = x * (z / (z - t));
} else if (z <= 920000000.0) {
tmp = x / (t / (y - z));
} else {
tmp = x - (y / (z / 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 <= (-6d-14)) then
tmp = x * (z / (z - t))
else if (z <= 920000000.0d0) then
tmp = x / (t / (y - z))
else
tmp = x - (y / (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6e-14) {
tmp = x * (z / (z - t));
} else if (z <= 920000000.0) {
tmp = x / (t / (y - z));
} else {
tmp = x - (y / (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6e-14: tmp = x * (z / (z - t)) elif z <= 920000000.0: tmp = x / (t / (y - z)) else: tmp = x - (y / (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6e-14) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 920000000.0) tmp = Float64(x / Float64(t / Float64(y - z))); else tmp = Float64(x - Float64(y / Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6e-14) tmp = x * (z / (z - t)); elseif (z <= 920000000.0) tmp = x / (t / (y - z)); else tmp = x - (y / (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6e-14], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 920000000.0], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 920000000:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -5.9999999999999997e-14Initial program 82.9%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
neg-mul-183.8%
distribute-neg-frac83.8%
Simplified83.8%
distribute-frac-neg83.8%
frac-2neg83.8%
distribute-frac-neg83.8%
remove-double-neg83.8%
associate-*r/68.2%
sub-neg68.2%
distribute-neg-in68.2%
remove-double-neg68.2%
Applied egg-rr68.2%
*-commutative68.2%
associate-/l*58.9%
associate-/r/83.8%
+-commutative83.8%
unsub-neg83.8%
Simplified83.8%
if -5.9999999999999997e-14 < z < 9.2e8Initial program 94.0%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in t around inf 75.8%
if 9.2e8 < z Initial program 74.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in t around 0 56.9%
mul-1-neg56.9%
associate-/l*65.3%
distribute-neg-frac65.3%
neg-sub065.3%
associate--r-65.3%
neg-sub065.3%
Simplified65.3%
Taylor expanded in y around 0 70.1%
+-commutative70.1%
mul-1-neg70.1%
unsub-neg70.1%
associate-*r/76.2%
Simplified76.2%
clear-num76.2%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification78.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.35e+33) (/ x (/ (- t z) y)) (if (<= y 6.8e+76) (* x (/ z (- z t))) (/ (* x y) (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.35e+33) {
tmp = x / ((t - z) / y);
} else if (y <= 6.8e+76) {
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 (y <= (-2.35d+33)) then
tmp = x / ((t - z) / y)
else if (y <= 6.8d+76) 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 (y <= -2.35e+33) {
tmp = x / ((t - z) / y);
} else if (y <= 6.8e+76) {
tmp = x * (z / (z - t));
} else {
tmp = (x * y) / (t - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.35e+33: tmp = x / ((t - z) / y) elif y <= 6.8e+76: tmp = x * (z / (z - t)) else: tmp = (x * y) / (t - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.35e+33) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (y <= 6.8e+76) 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 (y <= -2.35e+33) tmp = x / ((t - z) / y); elseif (y <= 6.8e+76) tmp = x * (z / (z - t)); else tmp = (x * y) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.35e+33], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+76], 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}\;y \leq -2.35 \cdot 10^{+33}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+76}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\end{array}
\end{array}
if y < -2.3499999999999999e33Initial program 83.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around inf 80.1%
if -2.3499999999999999e33 < y < 6.7999999999999994e76Initial program 84.9%
associate-*r/97.8%
Simplified97.8%
Taylor expanded in y around 0 82.2%
neg-mul-182.2%
distribute-neg-frac82.2%
Simplified82.2%
distribute-frac-neg82.2%
frac-2neg82.2%
distribute-frac-neg82.2%
remove-double-neg82.2%
associate-*r/68.4%
sub-neg68.4%
distribute-neg-in68.4%
remove-double-neg68.4%
Applied egg-rr68.4%
*-commutative68.4%
associate-/l*70.7%
associate-/r/82.2%
+-commutative82.2%
unsub-neg82.2%
Simplified82.2%
if 6.7999999999999994e76 < y Initial program 90.1%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in y around inf 73.0%
Final simplification80.1%
(FPCore (x y z t) :precision binary64 (if (<= z -9.5e-14) x (if (<= z 4200000000.0) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.5e-14) {
tmp = x;
} else if (z <= 4200000000.0) {
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 <= (-9.5d-14)) then
tmp = x
else if (z <= 4200000000.0d0) 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 <= -9.5e-14) {
tmp = x;
} else if (z <= 4200000000.0) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.5e-14: tmp = x elif z <= 4200000000.0: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.5e-14) tmp = x; elseif (z <= 4200000000.0) 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 <= -9.5e-14) tmp = x; elseif (z <= 4200000000.0) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.5e-14], x, If[LessEqual[z, 4200000000.0], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4200000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.4999999999999999e-14 or 4.2e9 < z Initial program 78.6%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 62.9%
if -9.4999999999999999e-14 < z < 4.2e9Initial program 94.0%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in z around 0 61.5%
Final simplification62.3%
(FPCore (x y z t) :precision binary64 (if (<= z -6.5e-14) x (if (<= z 550000000.0) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.5e-14) {
tmp = x;
} else if (z <= 550000000.0) {
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 <= (-6.5d-14)) then
tmp = x
else if (z <= 550000000.0d0) 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 <= -6.5e-14) {
tmp = x;
} else if (z <= 550000000.0) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.5e-14: tmp = x elif z <= 550000000.0: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.5e-14) tmp = x; elseif (z <= 550000000.0) 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 <= -6.5e-14) tmp = x; elseif (z <= 550000000.0) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.5e-14], x, If[LessEqual[z, 550000000.0], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 550000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.5000000000000001e-14 or 5.5e8 < z Initial program 78.6%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 62.9%
if -6.5000000000000001e-14 < z < 5.5e8Initial program 94.0%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around 0 61.5%
Final simplification62.3%
(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 85.5%
associate-*r/97.4%
Simplified97.4%
Final simplification97.4%
(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 85.5%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in z around inf 39.4%
Final simplification39.4%
(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 2023176
(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)))