
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 96.9%
associate-*l/81.0%
associate-*r/85.6%
Simplified85.6%
associate-*r/81.0%
associate-*l/96.9%
*-commutative96.9%
clear-num96.8%
un-div-inv97.1%
Applied egg-rr97.1%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.1e+150)
t
(if (or (<= y 0.00155) (and (not (<= y 1.55e+86)) (<= y 3.9e+126)))
(* x (/ t (- z y)))
t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e+150) {
tmp = t;
} else if ((y <= 0.00155) || (!(y <= 1.55e+86) && (y <= 3.9e+126))) {
tmp = x * (t / (z - y));
} else {
tmp = 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 <= (-5.1d+150)) then
tmp = t
else if ((y <= 0.00155d0) .or. (.not. (y <= 1.55d+86)) .and. (y <= 3.9d+126)) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e+150) {
tmp = t;
} else if ((y <= 0.00155) || (!(y <= 1.55e+86) && (y <= 3.9e+126))) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.1e+150: tmp = t elif (y <= 0.00155) or (not (y <= 1.55e+86) and (y <= 3.9e+126)): tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.1e+150) tmp = t; elseif ((y <= 0.00155) || (!(y <= 1.55e+86) && (y <= 3.9e+126))) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.1e+150) tmp = t; elseif ((y <= 0.00155) || (~((y <= 1.55e+86)) && (y <= 3.9e+126))) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.1e+150], t, If[Or[LessEqual[y, 0.00155], And[N[Not[LessEqual[y, 1.55e+86]], $MachinePrecision], LessEqual[y, 3.9e+126]]], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+150}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00155 \lor \neg \left(y \leq 1.55 \cdot 10^{+86}\right) \land y \leq 3.9 \cdot 10^{+126}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.1000000000000001e150 or 0.00154999999999999995 < y < 1.5500000000000001e86 or 3.89999999999999993e126 < y Initial program 99.9%
associate-*l/66.0%
associate-*r/70.8%
Simplified70.8%
Taylor expanded in y around inf 75.2%
if -5.1000000000000001e150 < y < 0.00154999999999999995 or 1.5500000000000001e86 < y < 3.89999999999999993e126Initial program 95.4%
associate-*l/88.6%
associate-*r/93.1%
Simplified93.1%
Taylor expanded in x around inf 70.7%
associate-*l/76.3%
*-commutative76.3%
Simplified76.3%
Final simplification75.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.5e+150)
t
(if (<= y 0.00155)
(* x (/ t (- z y)))
(if (<= y 5.6e+85) t (if (<= y 1.8e+121) (* t (/ x (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+150) {
tmp = t;
} else if (y <= 0.00155) {
tmp = x * (t / (z - y));
} else if (y <= 5.6e+85) {
tmp = t;
} else if (y <= 1.8e+121) {
tmp = t * (x / (z - y));
} else {
tmp = 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 <= (-7.5d+150)) then
tmp = t
else if (y <= 0.00155d0) then
tmp = x * (t / (z - y))
else if (y <= 5.6d+85) then
tmp = t
else if (y <= 1.8d+121) then
tmp = t * (x / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+150) {
tmp = t;
} else if (y <= 0.00155) {
tmp = x * (t / (z - y));
} else if (y <= 5.6e+85) {
tmp = t;
} else if (y <= 1.8e+121) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e+150: tmp = t elif y <= 0.00155: tmp = x * (t / (z - y)) elif y <= 5.6e+85: tmp = t elif y <= 1.8e+121: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+150) tmp = t; elseif (y <= 0.00155) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 5.6e+85) tmp = t; elseif (y <= 1.8e+121) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e+150) tmp = t; elseif (y <= 0.00155) tmp = x * (t / (z - y)); elseif (y <= 5.6e+85) tmp = t; elseif (y <= 1.8e+121) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+150], t, If[LessEqual[y, 0.00155], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+85], t, If[LessEqual[y, 1.8e+121], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+150}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00155:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+85}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+121}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.4999999999999998e150 or 0.00154999999999999995 < y < 5.5999999999999998e85 or 1.79999999999999991e121 < y Initial program 99.9%
associate-*l/66.0%
associate-*r/70.8%
Simplified70.8%
Taylor expanded in y around inf 75.2%
if -7.4999999999999998e150 < y < 0.00154999999999999995Initial program 95.1%
associate-*l/89.2%
associate-*r/93.5%
Simplified93.5%
Taylor expanded in x around inf 71.5%
associate-*l/76.4%
*-commutative76.4%
Simplified76.4%
if 5.5999999999999998e85 < y < 1.79999999999999991e121Initial program 99.7%
Taylor expanded in x around inf 77.9%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.45e+152)
t
(if (<= y 0.00155)
(* x (/ t (- z y)))
(if (<= y 5.2e+85)
(+ t (/ t (/ y z)))
(if (<= y 6.5e+117) (* t (/ x (- z y))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e+152) {
tmp = t;
} else if (y <= 0.00155) {
tmp = x * (t / (z - y));
} else if (y <= 5.2e+85) {
tmp = t + (t / (y / z));
} else if (y <= 6.5e+117) {
tmp = t * (x / (z - y));
} else {
tmp = 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 <= (-1.45d+152)) then
tmp = t
else if (y <= 0.00155d0) then
tmp = x * (t / (z - y))
else if (y <= 5.2d+85) then
tmp = t + (t / (y / z))
else if (y <= 6.5d+117) then
tmp = t * (x / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e+152) {
tmp = t;
} else if (y <= 0.00155) {
tmp = x * (t / (z - y));
} else if (y <= 5.2e+85) {
tmp = t + (t / (y / z));
} else if (y <= 6.5e+117) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.45e+152: tmp = t elif y <= 0.00155: tmp = x * (t / (z - y)) elif y <= 5.2e+85: tmp = t + (t / (y / z)) elif y <= 6.5e+117: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.45e+152) tmp = t; elseif (y <= 0.00155) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 5.2e+85) tmp = Float64(t + Float64(t / Float64(y / z))); elseif (y <= 6.5e+117) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.45e+152) tmp = t; elseif (y <= 0.00155) tmp = x * (t / (z - y)); elseif (y <= 5.2e+85) tmp = t + (t / (y / z)); elseif (y <= 6.5e+117) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.45e+152], t, If[LessEqual[y, 0.00155], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+85], N[(t + N[(t / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+117], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+152}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00155:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+85}:\\
\;\;\;\;t + \frac{t}{\frac{y}{z}}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+117}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.4499999999999999e152 or 6.5000000000000004e117 < y Initial program 99.9%
associate-*l/60.9%
associate-*r/64.2%
Simplified64.2%
Taylor expanded in y around inf 76.5%
if -1.4499999999999999e152 < y < 0.00154999999999999995Initial program 95.1%
associate-*l/89.2%
associate-*r/93.5%
Simplified93.5%
Taylor expanded in x around inf 71.5%
associate-*l/76.4%
*-commutative76.4%
Simplified76.4%
if 0.00154999999999999995 < y < 5.20000000000000021e85Initial program 99.6%
associate-*l/88.3%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in y around inf 81.7%
associate--l+81.7%
distribute-lft-out--81.7%
div-sub81.7%
mul-1-neg81.7%
unsub-neg81.7%
distribute-lft-out--81.7%
Simplified81.7%
Taylor expanded in x around 0 70.3%
sub-neg70.3%
mul-1-neg70.3%
remove-double-neg70.3%
associate-/l*70.3%
Simplified70.3%
if 5.20000000000000021e85 < y < 6.5000000000000004e117Initial program 99.7%
Taylor expanded in x around inf 77.9%
Final simplification76.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.8e+37)
t
(if (<= y 0.00013)
(/ t (/ z x))
(if (<= y 6e+95) t (if (<= y 2e+114) (- (* (/ t y) x)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e+37) {
tmp = t;
} else if (y <= 0.00013) {
tmp = t / (z / x);
} else if (y <= 6e+95) {
tmp = t;
} else if (y <= 2e+114) {
tmp = -((t / y) * x);
} else {
tmp = 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 <= (-5.8d+37)) then
tmp = t
else if (y <= 0.00013d0) then
tmp = t / (z / x)
else if (y <= 6d+95) then
tmp = t
else if (y <= 2d+114) then
tmp = -((t / y) * x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e+37) {
tmp = t;
} else if (y <= 0.00013) {
tmp = t / (z / x);
} else if (y <= 6e+95) {
tmp = t;
} else if (y <= 2e+114) {
tmp = -((t / y) * x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.8e+37: tmp = t elif y <= 0.00013: tmp = t / (z / x) elif y <= 6e+95: tmp = t elif y <= 2e+114: tmp = -((t / y) * x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.8e+37) tmp = t; elseif (y <= 0.00013) tmp = Float64(t / Float64(z / x)); elseif (y <= 6e+95) tmp = t; elseif (y <= 2e+114) tmp = Float64(-Float64(Float64(t / y) * x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.8e+37) tmp = t; elseif (y <= 0.00013) tmp = t / (z / x); elseif (y <= 6e+95) tmp = t; elseif (y <= 2e+114) tmp = -((t / y) * x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e+37], t, If[LessEqual[y, 0.00013], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+95], t, If[LessEqual[y, 2e+114], (-N[(N[(t / y), $MachinePrecision] * x), $MachinePrecision]), t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+37}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00013:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+95}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+114}:\\
\;\;\;\;-\frac{t}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.79999999999999957e37 or 1.29999999999999989e-4 < y < 5.99999999999999982e95 or 2e114 < y Initial program 99.8%
associate-*l/68.5%
associate-*r/73.5%
Simplified73.5%
Taylor expanded in y around inf 66.9%
if -5.79999999999999957e37 < y < 1.29999999999999989e-4Initial program 94.6%
associate-*l/90.4%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in y around 0 66.6%
associate-/l*70.6%
Simplified70.6%
if 5.99999999999999982e95 < y < 2e114Initial program 99.6%
associate-*l/76.3%
associate-*r/84.3%
Simplified84.3%
Taylor expanded in x around inf 51.6%
associate-*l/71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in z around 0 71.4%
associate-*r/71.4%
neg-mul-171.4%
Simplified71.4%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.9e+129) (- t (/ t (/ y x))) (if (<= y 2.5e+199) (* (- x y) (/ t (- z y))) (* (- t) (/ y (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e+129) {
tmp = t - (t / (y / x));
} else if (y <= 2.5e+199) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = -t * (y / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.9d+129)) then
tmp = t - (t / (y / x))
else if (y <= 2.5d+199) then
tmp = (x - y) * (t / (z - y))
else
tmp = -t * (y / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e+129) {
tmp = t - (t / (y / x));
} else if (y <= 2.5e+199) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = -t * (y / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.9e+129: tmp = t - (t / (y / x)) elif y <= 2.5e+199: tmp = (x - y) * (t / (z - y)) else: tmp = -t * (y / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e+129) tmp = Float64(t - Float64(t / Float64(y / x))); elseif (y <= 2.5e+199) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(Float64(-t) * Float64(y / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.9e+129) tmp = t - (t / (y / x)); elseif (y <= 2.5e+199) tmp = (x - y) * (t / (z - y)); else tmp = -t * (y / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e+129], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+199], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) * N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+129}:\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+199}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z - y}\\
\end{array}
\end{array}
if y < -1.90000000000000003e129Initial program 99.9%
associate-*l/69.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in y around inf 74.5%
associate--l+74.5%
distribute-lft-out--74.5%
div-sub74.5%
mul-1-neg74.5%
unsub-neg74.5%
distribute-lft-out--74.6%
Simplified74.6%
Taylor expanded in x around inf 77.8%
associate-/l*90.2%
Simplified90.2%
if -1.90000000000000003e129 < y < 2.4999999999999999e199Initial program 95.9%
associate-*l/86.9%
associate-*r/93.7%
Simplified93.7%
if 2.4999999999999999e199 < y Initial program 99.9%
Taylor expanded in x around 0 93.0%
neg-mul-193.0%
distribute-neg-frac93.0%
Simplified93.0%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.1e+39) (not (<= y 0.0012))) (- t (/ t (/ y x))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.1e+39) || !(y <= 0.0012)) {
tmp = t - (t / (y / x));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.1d+39)) .or. (.not. (y <= 0.0012d0))) then
tmp = t - (t / (y / x))
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.1e+39) || !(y <= 0.0012)) {
tmp = t - (t / (y / x));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.1e+39) or not (y <= 0.0012): tmp = t - (t / (y / x)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.1e+39) || !(y <= 0.0012)) tmp = Float64(t - Float64(t / Float64(y / x))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.1e+39) || ~((y <= 0.0012))) tmp = t - (t / (y / x)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.1e+39], N[Not[LessEqual[y, 0.0012]], $MachinePrecision]], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+39} \lor \neg \left(y \leq 0.0012\right):\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -1.1000000000000001e39 or 0.00119999999999999989 < y Initial program 99.8%
associate-*l/69.1%
associate-*r/74.3%
Simplified74.3%
Taylor expanded in y around inf 71.7%
associate--l+71.7%
distribute-lft-out--71.7%
div-sub71.7%
mul-1-neg71.7%
unsub-neg71.7%
distribute-lft-out--71.7%
Simplified71.7%
Taylor expanded in x around inf 73.5%
associate-/l*81.0%
Simplified81.0%
if -1.1000000000000001e39 < y < 0.00119999999999999989Initial program 94.6%
associate-*l/90.4%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in x around inf 77.2%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8e+37) (not (<= y 0.0014))) (- t (/ t (/ y x))) (/ x (/ (- z y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8e+37) || !(y <= 0.0014)) {
tmp = t - (t / (y / x));
} else {
tmp = x / ((z - y) / 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 <= (-8d+37)) .or. (.not. (y <= 0.0014d0))) then
tmp = t - (t / (y / x))
else
tmp = x / ((z - y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8e+37) || !(y <= 0.0014)) {
tmp = t - (t / (y / x));
} else {
tmp = x / ((z - y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8e+37) or not (y <= 0.0014): tmp = t - (t / (y / x)) else: tmp = x / ((z - y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8e+37) || !(y <= 0.0014)) tmp = Float64(t - Float64(t / Float64(y / x))); else tmp = Float64(x / Float64(Float64(z - y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8e+37) || ~((y <= 0.0014))) tmp = t - (t / (y / x)); else tmp = x / ((z - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8e+37], N[Not[LessEqual[y, 0.0014]], $MachinePrecision]], N[(t - N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+37} \lor \neg \left(y \leq 0.0014\right):\\
\;\;\;\;t - \frac{t}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z - y}{t}}\\
\end{array}
\end{array}
if y < -7.99999999999999963e37 or 0.00139999999999999999 < y Initial program 99.8%
associate-*l/69.1%
associate-*r/74.3%
Simplified74.3%
Taylor expanded in y around inf 71.7%
associate--l+71.7%
distribute-lft-out--71.7%
div-sub71.7%
mul-1-neg71.7%
unsub-neg71.7%
distribute-lft-out--71.7%
Simplified71.7%
Taylor expanded in x around inf 73.5%
associate-/l*81.0%
Simplified81.0%
if -7.99999999999999963e37 < y < 0.00139999999999999999Initial program 94.6%
associate-*l/90.4%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in x around inf 77.2%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
clear-num81.4%
un-div-inv81.8%
Applied egg-rr81.8%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= y -6.4e+36) t (if (<= y 0.00095) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e+36) {
tmp = t;
} else if (y <= 0.00095) {
tmp = x * (t / z);
} else {
tmp = 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 <= (-6.4d+36)) then
tmp = t
else if (y <= 0.00095d0) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e+36) {
tmp = t;
} else if (y <= 0.00095) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.4e+36: tmp = t elif y <= 0.00095: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.4e+36) tmp = t; elseif (y <= 0.00095) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.4e+36) tmp = t; elseif (y <= 0.00095) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.4e+36], t, If[LessEqual[y, 0.00095], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+36}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00095:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.3999999999999998e36 or 9.49999999999999998e-4 < y Initial program 99.8%
associate-*l/69.1%
associate-*r/74.3%
Simplified74.3%
Taylor expanded in y around inf 63.3%
if -6.3999999999999998e36 < y < 9.49999999999999998e-4Initial program 94.6%
associate-*l/90.4%
associate-*r/94.5%
Simplified94.5%
associate-*r/90.4%
associate-*l/94.6%
*-commutative94.6%
clear-num94.4%
un-div-inv95.0%
Applied egg-rr95.0%
Taylor expanded in y around 0 66.6%
associate-/l*70.6%
associate-/r/69.4%
Simplified69.4%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (<= y -9.5e+36) t (if (<= y 1.15e-5) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+36) {
tmp = t;
} else if (y <= 1.15e-5) {
tmp = t * (x / z);
} else {
tmp = 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 <= (-9.5d+36)) then
tmp = t
else if (y <= 1.15d-5) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+36) {
tmp = t;
} else if (y <= 1.15e-5) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.5e+36: tmp = t elif y <= 1.15e-5: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e+36) tmp = t; elseif (y <= 1.15e-5) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9.5e+36) tmp = t; elseif (y <= 1.15e-5) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e+36], t, If[LessEqual[y, 1.15e-5], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+36}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-5}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -9.49999999999999974e36 or 1.15e-5 < y Initial program 99.8%
associate-*l/69.1%
associate-*r/74.3%
Simplified74.3%
Taylor expanded in y around inf 63.3%
if -9.49999999999999974e36 < y < 1.15e-5Initial program 94.6%
Taylor expanded in y around 0 70.1%
Final simplification67.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.1e+40) t (if (<= y 0.00085) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+40) {
tmp = t;
} else if (y <= 0.00085) {
tmp = t / (z / x);
} else {
tmp = 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 <= (-1.1d+40)) then
tmp = t
else if (y <= 0.00085d0) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e+40) {
tmp = t;
} else if (y <= 0.00085) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e+40: tmp = t elif y <= 0.00085: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e+40) tmp = t; elseif (y <= 0.00085) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e+40) tmp = t; elseif (y <= 0.00085) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e+40], t, If[LessEqual[y, 0.00085], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+40}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.00085:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.0999999999999999e40 or 8.49999999999999953e-4 < y Initial program 99.8%
associate-*l/69.1%
associate-*r/74.3%
Simplified74.3%
Taylor expanded in y around inf 63.3%
if -1.0999999999999999e40 < y < 8.49999999999999953e-4Initial program 94.6%
associate-*l/90.4%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in y around 0 66.6%
associate-/l*70.6%
Simplified70.6%
Final simplification67.4%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
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 = t * ((x - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 96.9%
Final simplification96.9%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 96.9%
associate-*l/81.0%
associate-*r/85.6%
Simplified85.6%
Taylor expanded in y around inf 33.2%
Final simplification33.2%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
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 = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2023176
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))