
(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 12 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 82.9%
associate-/l*96.5%
Simplified96.5%
clear-num96.4%
un-div-inv96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -3.1e+46)
(and (not (<= z -160000000.0))
(or (<= z -3.5e-89) (not (<= z 6.8e+16)))))
(* x (- 1.0 (/ y z)))
(* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.1e+46) || (!(z <= -160000000.0) && ((z <= -3.5e-89) || !(z <= 6.8e+16)))) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.1d+46)) .or. (.not. (z <= (-160000000.0d0))) .and. (z <= (-3.5d-89)) .or. (.not. (z <= 6.8d+16))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.1e+46) || (!(z <= -160000000.0) && ((z <= -3.5e-89) || !(z <= 6.8e+16)))) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.1e+46) or (not (z <= -160000000.0) and ((z <= -3.5e-89) or not (z <= 6.8e+16))): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.1e+46) || (!(z <= -160000000.0) && ((z <= -3.5e-89) || !(z <= 6.8e+16)))) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.1e+46) || (~((z <= -160000000.0)) && ((z <= -3.5e-89) || ~((z <= 6.8e+16))))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.1e+46], And[N[Not[LessEqual[z, -160000000.0]], $MachinePrecision], Or[LessEqual[z, -3.5e-89], N[Not[LessEqual[z, 6.8e+16]], $MachinePrecision]]]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+46} \lor \neg \left(z \leq -160000000\right) \land \left(z \leq -3.5 \cdot 10^{-89} \lor \neg \left(z \leq 6.8 \cdot 10^{+16}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -3.09999999999999975e46 or -1.6e8 < z < -3.4999999999999997e-89 or 6.8e16 < z Initial program 73.6%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in t around 0 52.3%
mul-1-neg52.3%
associate-/l*71.2%
distribute-rgt-neg-in71.2%
distribute-frac-neg71.2%
neg-sub071.2%
associate--r-71.2%
neg-sub071.2%
+-commutative71.2%
sub-neg71.2%
div-sub71.2%
*-inverses71.2%
Simplified71.2%
if -3.09999999999999975e46 < z < -1.6e8 or -3.4999999999999997e-89 < z < 6.8e16Initial program 93.5%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in y around inf 76.0%
associate-/l*76.7%
Simplified76.7%
Final simplification73.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))) (t_2 (* x (/ y (- t z)))))
(if (<= y -3.5e+84)
t_2
(if (<= y -1.1e-80)
t_1
(if (<= y -4.45e-100) (/ y (/ t x)) (if (<= y 9e+113) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double t_2 = x * (y / (t - z));
double tmp;
if (y <= -3.5e+84) {
tmp = t_2;
} else if (y <= -1.1e-80) {
tmp = t_1;
} else if (y <= -4.45e-100) {
tmp = y / (t / x);
} else if (y <= 9e+113) {
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 * (z / (z - t))
t_2 = x * (y / (t - z))
if (y <= (-3.5d+84)) then
tmp = t_2
else if (y <= (-1.1d-80)) then
tmp = t_1
else if (y <= (-4.45d-100)) then
tmp = y / (t / x)
else if (y <= 9d+113) 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 * (z / (z - t));
double t_2 = x * (y / (t - z));
double tmp;
if (y <= -3.5e+84) {
tmp = t_2;
} else if (y <= -1.1e-80) {
tmp = t_1;
} else if (y <= -4.45e-100) {
tmp = y / (t / x);
} else if (y <= 9e+113) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) t_2 = x * (y / (t - z)) tmp = 0 if y <= -3.5e+84: tmp = t_2 elif y <= -1.1e-80: tmp = t_1 elif y <= -4.45e-100: tmp = y / (t / x) elif y <= 9e+113: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) t_2 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -3.5e+84) tmp = t_2; elseif (y <= -1.1e-80) tmp = t_1; elseif (y <= -4.45e-100) tmp = Float64(y / Float64(t / x)); elseif (y <= 9e+113) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z / (z - t)); t_2 = x * (y / (t - z)); tmp = 0.0; if (y <= -3.5e+84) tmp = t_2; elseif (y <= -1.1e-80) tmp = t_1; elseif (y <= -4.45e-100) tmp = y / (t / x); elseif (y <= 9e+113) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+84], t$95$2, If[LessEqual[y, -1.1e-80], t$95$1, If[LessEqual[y, -4.45e-100], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+113], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
t_2 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4.45 \cdot 10^{-100}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.4999999999999999e84 or 9.0000000000000001e113 < y Initial program 80.3%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in y around inf 73.0%
associate-/l*83.8%
Simplified83.8%
if -3.4999999999999999e84 < y < -1.10000000000000005e-80 or -4.4500000000000002e-100 < y < 9.0000000000000001e113Initial program 83.6%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in y around 0 63.7%
mul-1-neg63.7%
distribute-neg-frac263.7%
neg-sub063.7%
associate--r-63.7%
neg-sub063.7%
+-commutative63.7%
sub-neg63.7%
associate-/l*76.5%
Simplified76.5%
if -1.10000000000000005e-80 < y < -4.4500000000000002e-100Initial program 99.8%
associate-/l*86.2%
Simplified86.2%
Taylor expanded in z around 0 99.8%
*-commutative99.8%
associate-/l*99.6%
Applied egg-rr99.6%
clear-num99.6%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification79.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- y z) t))))
(if (<= t -2.1e+118)
t_1
(if (<= t -6e+37)
(* x (/ z (- z t)))
(if (<= t -1.15e-105)
(* x (/ y (- t z)))
(if (<= t 7.2e+75) (* x (- 1.0 (/ y z))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - z) / t);
double tmp;
if (t <= -2.1e+118) {
tmp = t_1;
} else if (t <= -6e+37) {
tmp = x * (z / (z - t));
} else if (t <= -1.15e-105) {
tmp = x * (y / (t - z));
} else if (t <= 7.2e+75) {
tmp = x * (1.0 - (y / z));
} 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 * ((y - z) / t)
if (t <= (-2.1d+118)) then
tmp = t_1
else if (t <= (-6d+37)) then
tmp = x * (z / (z - t))
else if (t <= (-1.15d-105)) then
tmp = x * (y / (t - z))
else if (t <= 7.2d+75) then
tmp = x * (1.0d0 - (y / z))
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 * ((y - z) / t);
double tmp;
if (t <= -2.1e+118) {
tmp = t_1;
} else if (t <= -6e+37) {
tmp = x * (z / (z - t));
} else if (t <= -1.15e-105) {
tmp = x * (y / (t - z));
} else if (t <= 7.2e+75) {
tmp = x * (1.0 - (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - z) / t) tmp = 0 if t <= -2.1e+118: tmp = t_1 elif t <= -6e+37: tmp = x * (z / (z - t)) elif t <= -1.15e-105: tmp = x * (y / (t - z)) elif t <= 7.2e+75: tmp = x * (1.0 - (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -2.1e+118) tmp = t_1; elseif (t <= -6e+37) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (t <= -1.15e-105) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (t <= 7.2e+75) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - z) / t); tmp = 0.0; if (t <= -2.1e+118) tmp = t_1; elseif (t <= -6e+37) tmp = x * (z / (z - t)); elseif (t <= -1.15e-105) tmp = x * (y / (t - z)); elseif (t <= 7.2e+75) tmp = x * (1.0 - (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+118], t$95$1, If[LessEqual[t, -6e+37], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.15e-105], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+75], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6 \cdot 10^{+37}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-105}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+75}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1e118 or 7.2e75 < t Initial program 82.4%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in t around inf 75.1%
associate-/l*82.2%
Simplified82.2%
if -2.1e118 < t < -6.00000000000000043e37Initial program 72.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 60.4%
mul-1-neg60.4%
distribute-neg-frac260.4%
neg-sub060.4%
associate--r-60.4%
neg-sub060.4%
+-commutative60.4%
sub-neg60.4%
associate-/l*87.8%
Simplified87.8%
if -6.00000000000000043e37 < t < -1.15e-105Initial program 83.8%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in y around inf 63.7%
associate-/l*66.6%
Simplified66.6%
if -1.15e-105 < t < 7.2e75Initial program 85.4%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around 0 69.7%
mul-1-neg69.7%
associate-/l*79.9%
distribute-rgt-neg-in79.9%
distribute-frac-neg79.9%
neg-sub079.9%
associate--r-79.9%
neg-sub079.9%
+-commutative79.9%
sub-neg79.9%
div-sub79.9%
*-inverses79.9%
Simplified79.9%
Final simplification80.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ (- t z) y))))
(if (<= y -1.7e+87)
t_1
(if (<= y -2.4e-82)
(* x (/ z (- z t)))
(if (<= y -4.45e-100)
(/ y (/ t x))
(if (<= y 5.6e+114) (/ x (- 1.0 (/ t z))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((t - z) / y);
double tmp;
if (y <= -1.7e+87) {
tmp = t_1;
} else if (y <= -2.4e-82) {
tmp = x * (z / (z - t));
} else if (y <= -4.45e-100) {
tmp = y / (t / x);
} else if (y <= 5.6e+114) {
tmp = x / (1.0 - (t / z));
} 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 / ((t - z) / y)
if (y <= (-1.7d+87)) then
tmp = t_1
else if (y <= (-2.4d-82)) then
tmp = x * (z / (z - t))
else if (y <= (-4.45d-100)) then
tmp = y / (t / x)
else if (y <= 5.6d+114) then
tmp = x / (1.0d0 - (t / z))
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 / ((t - z) / y);
double tmp;
if (y <= -1.7e+87) {
tmp = t_1;
} else if (y <= -2.4e-82) {
tmp = x * (z / (z - t));
} else if (y <= -4.45e-100) {
tmp = y / (t / x);
} else if (y <= 5.6e+114) {
tmp = x / (1.0 - (t / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((t - z) / y) tmp = 0 if y <= -1.7e+87: tmp = t_1 elif y <= -2.4e-82: tmp = x * (z / (z - t)) elif y <= -4.45e-100: tmp = y / (t / x) elif y <= 5.6e+114: tmp = x / (1.0 - (t / z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(t - z) / y)) tmp = 0.0 if (y <= -1.7e+87) tmp = t_1; elseif (y <= -2.4e-82) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (y <= -4.45e-100) tmp = Float64(y / Float64(t / x)); elseif (y <= 5.6e+114) tmp = Float64(x / Float64(1.0 - Float64(t / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((t - z) / y); tmp = 0.0; if (y <= -1.7e+87) tmp = t_1; elseif (y <= -2.4e-82) tmp = x * (z / (z - t)); elseif (y <= -4.45e-100) tmp = y / (t / x); elseif (y <= 5.6e+114) tmp = x / (1.0 - (t / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+87], t$95$1, If[LessEqual[y, -2.4e-82], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.45e-100], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+114], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{t - z}{y}}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-82}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;y \leq -4.45 \cdot 10^{-100}:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+114}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.7000000000000001e87 or 5.6000000000000001e114 < y Initial program 80.3%
associate-/l*96.5%
Simplified96.5%
clear-num96.4%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in y around inf 85.0%
if -1.7000000000000001e87 < y < -2.40000000000000008e-82Initial program 93.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in y around 0 55.5%
mul-1-neg55.5%
distribute-neg-frac255.5%
neg-sub055.5%
associate--r-55.5%
neg-sub055.5%
+-commutative55.5%
sub-neg55.5%
associate-/l*61.2%
Simplified61.2%
if -2.40000000000000008e-82 < y < -4.4500000000000002e-100Initial program 99.8%
associate-/l*86.2%
Simplified86.2%
Taylor expanded in z around 0 99.8%
*-commutative99.8%
associate-/l*99.6%
Applied egg-rr99.6%
clear-num99.6%
un-div-inv100.0%
Applied egg-rr100.0%
if -4.4500000000000002e-100 < y < 5.6000000000000001e114Initial program 81.1%
associate-/l*96.2%
Simplified96.2%
clear-num96.2%
un-div-inv96.2%
Applied egg-rr96.2%
Taylor expanded in y around 0 80.2%
mul-1-neg80.2%
div-sub80.3%
sub-neg80.3%
*-inverses80.3%
metadata-eval80.3%
Simplified80.3%
Taylor expanded in x around 0 80.3%
Final simplification80.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.2e+43)
x
(if (or (<= z -250000000.0)
(and (not (<= z -7.8e-91)) (<= z 52000000000.0)))
(* x (/ y t))
x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.2e+43) {
tmp = x;
} else if ((z <= -250000000.0) || (!(z <= -7.8e-91) && (z <= 52000000000.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 <= (-7.2d+43)) then
tmp = x
else if ((z <= (-250000000.0d0)) .or. (.not. (z <= (-7.8d-91))) .and. (z <= 52000000000.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 <= -7.2e+43) {
tmp = x;
} else if ((z <= -250000000.0) || (!(z <= -7.8e-91) && (z <= 52000000000.0))) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.2e+43: tmp = x elif (z <= -250000000.0) or (not (z <= -7.8e-91) and (z <= 52000000000.0)): tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.2e+43) tmp = x; elseif ((z <= -250000000.0) || (!(z <= -7.8e-91) && (z <= 52000000000.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 <= -7.2e+43) tmp = x; elseif ((z <= -250000000.0) || (~((z <= -7.8e-91)) && (z <= 52000000000.0))) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.2e+43], x, If[Or[LessEqual[z, -250000000.0], And[N[Not[LessEqual[z, -7.8e-91]], $MachinePrecision], LessEqual[z, 52000000000.0]]], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+43}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -250000000 \lor \neg \left(z \leq -7.8 \cdot 10^{-91}\right) \land z \leq 52000000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.2000000000000002e43 or -2.5e8 < z < -7.79999999999999987e-91 or 5.2e10 < z Initial program 74.3%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in z around inf 55.2%
if -7.2000000000000002e43 < z < -2.5e8 or -7.79999999999999987e-91 < z < 5.2e10Initial program 93.3%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in z around 0 63.6%
associate-/l*66.8%
Simplified66.8%
Final simplification60.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.5e+49)
x
(if (or (<= z -200000000.0)
(and (not (<= z -8.8e-91)) (<= z 45000000000.0)))
(/ x (/ t y))
x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+49) {
tmp = x;
} else if ((z <= -200000000.0) || (!(z <= -8.8e-91) && (z <= 45000000000.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 <= (-5.5d+49)) then
tmp = x
else if ((z <= (-200000000.0d0)) .or. (.not. (z <= (-8.8d-91))) .and. (z <= 45000000000.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 <= -5.5e+49) {
tmp = x;
} else if ((z <= -200000000.0) || (!(z <= -8.8e-91) && (z <= 45000000000.0))) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e+49: tmp = x elif (z <= -200000000.0) or (not (z <= -8.8e-91) and (z <= 45000000000.0)): tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+49) tmp = x; elseif ((z <= -200000000.0) || (!(z <= -8.8e-91) && (z <= 45000000000.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 <= -5.5e+49) tmp = x; elseif ((z <= -200000000.0) || (~((z <= -8.8e-91)) && (z <= 45000000000.0))) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+49], x, If[Or[LessEqual[z, -200000000.0], And[N[Not[LessEqual[z, -8.8e-91]], $MachinePrecision], LessEqual[z, 45000000000.0]]], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+49}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -200000000 \lor \neg \left(z \leq -8.8 \cdot 10^{-91}\right) \land z \leq 45000000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.50000000000000042e49 or -2e8 < z < -8.8000000000000003e-91 or 4.5e10 < z Initial program 74.3%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in z around inf 55.2%
if -5.50000000000000042e49 < z < -2e8 or -8.8000000000000003e-91 < z < 4.5e10Initial program 93.3%
associate-/l*93.3%
Simplified93.3%
clear-num93.3%
un-div-inv94.2%
Applied egg-rr94.2%
Taylor expanded in z around 0 66.9%
Final simplification60.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -4e+78)
x
(if (<= z -55.0)
(* x (/ (- z) t))
(if (<= z -8.8e-91)
(* x (/ y (- z)))
(if (<= z 2050000000.0) (/ x (/ t y)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+78) {
tmp = x;
} else if (z <= -55.0) {
tmp = x * (-z / t);
} else if (z <= -8.8e-91) {
tmp = x * (y / -z);
} else if (z <= 2050000000.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 <= (-4d+78)) then
tmp = x
else if (z <= (-55.0d0)) then
tmp = x * (-z / t)
else if (z <= (-8.8d-91)) then
tmp = x * (y / -z)
else if (z <= 2050000000.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 <= -4e+78) {
tmp = x;
} else if (z <= -55.0) {
tmp = x * (-z / t);
} else if (z <= -8.8e-91) {
tmp = x * (y / -z);
} else if (z <= 2050000000.0) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4e+78: tmp = x elif z <= -55.0: tmp = x * (-z / t) elif z <= -8.8e-91: tmp = x * (y / -z) elif z <= 2050000000.0: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4e+78) tmp = x; elseif (z <= -55.0) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -8.8e-91) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= 2050000000.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 <= -4e+78) tmp = x; elseif (z <= -55.0) tmp = x * (-z / t); elseif (z <= -8.8e-91) tmp = x * (y / -z); elseif (z <= 2050000000.0) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e+78], x, If[LessEqual[z, -55.0], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.8e-91], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2050000000.0], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+78}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -55:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-91}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq 2050000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.00000000000000003e78 or 2.05e9 < z Initial program 67.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.5%
if -4.00000000000000003e78 < z < -55Initial program 95.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 58.8%
associate-/l*62.5%
Simplified62.5%
Taylor expanded in y around 0 40.7%
mul-1-neg40.7%
associate-/l*40.5%
distribute-rgt-neg-in40.5%
distribute-neg-frac240.5%
Simplified40.5%
if -55 < z < -8.8000000000000003e-91Initial program 99.8%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around inf 51.4%
associate-/l*51.2%
Simplified51.2%
Taylor expanded in t around 0 41.3%
associate-*r/41.3%
neg-mul-141.3%
Simplified41.3%
if -8.8000000000000003e-91 < z < 2.05e9Initial program 93.4%
associate-/l*92.4%
Simplified92.4%
clear-num92.4%
un-div-inv93.5%
Applied egg-rr93.5%
Taylor expanded in z around 0 69.6%
Final simplification60.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.2e+48)
x
(if (<= z -8.8e-91)
(/ (* x (- y)) z)
(if (<= z 12500000000.0) (/ x (/ t y)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e+48) {
tmp = x;
} else if (z <= -8.8e-91) {
tmp = (x * -y) / z;
} else if (z <= 12500000000.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 <= (-8.2d+48)) then
tmp = x
else if (z <= (-8.8d-91)) then
tmp = (x * -y) / z
else if (z <= 12500000000.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 <= -8.2e+48) {
tmp = x;
} else if (z <= -8.8e-91) {
tmp = (x * -y) / z;
} else if (z <= 12500000000.0) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.2e+48: tmp = x elif z <= -8.8e-91: tmp = (x * -y) / z elif z <= 12500000000.0: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.2e+48) tmp = x; elseif (z <= -8.8e-91) tmp = Float64(Float64(x * Float64(-y)) / z); elseif (z <= 12500000000.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 <= -8.2e+48) tmp = x; elseif (z <= -8.8e-91) tmp = (x * -y) / z; elseif (z <= 12500000000.0) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.2e+48], x, If[LessEqual[z, -8.8e-91], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 12500000000.0], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+48}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\
\mathbf{elif}\;z \leq 12500000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.2000000000000005e48 or 1.25e10 < z Initial program 69.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 59.2%
if -8.2000000000000005e48 < z < -8.8000000000000003e-91Initial program 97.2%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in y around inf 54.6%
associate-/l*57.1%
Simplified57.1%
Taylor expanded in t around 0 38.6%
associate-*r/38.6%
mul-1-neg38.6%
distribute-rgt-neg-out38.6%
Simplified38.6%
if -8.8000000000000003e-91 < z < 1.25e10Initial program 93.4%
associate-/l*92.4%
Simplified92.4%
clear-num92.4%
un-div-inv93.5%
Applied egg-rr93.5%
Taylor expanded in z around 0 69.6%
Final simplification60.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e-98) (not (<= z 210000000.0))) (* x (- 1.0 (/ y z))) (/ x (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-98) || !(z <= 210000000.0)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.05d-98)) .or. (.not. (z <= 210000000.0d0))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-98) || !(z <= 210000000.0)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e-98) or not (z <= 210000000.0): tmp = x * (1.0 - (y / z)) else: tmp = x / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e-98) || !(z <= 210000000.0)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.05e-98) || ~((z <= 210000000.0))) tmp = x * (1.0 - (y / z)); else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e-98], N[Not[LessEqual[z, 210000000.0]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-98} \lor \neg \left(z \leq 210000000\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -1.04999999999999996e-98 or 2.1e8 < z Initial program 75.9%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around 0 51.3%
mul-1-neg51.3%
associate-/l*68.1%
distribute-rgt-neg-in68.1%
distribute-frac-neg68.1%
neg-sub068.1%
associate--r-68.1%
neg-sub068.1%
+-commutative68.1%
sub-neg68.1%
div-sub68.1%
*-inverses68.1%
Simplified68.1%
if -1.04999999999999996e-98 < z < 2.1e8Initial program 93.4%
associate-/l*92.4%
Simplified92.4%
clear-num92.4%
un-div-inv93.5%
Applied egg-rr93.5%
Taylor expanded in z around 0 69.6%
Final simplification68.7%
(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 82.9%
associate-/l*96.5%
Simplified96.5%
Final simplification96.5%
(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 82.9%
associate-/l*96.5%
Simplified96.5%
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 2024082
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))