
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (- y z))) (t_2 (/ t_1 (- a z))))
(if (or (<= t_2 -2e+230) (not (<= t_2 5e+281)))
(+ x (/ (- z y) (/ (- z a) t)))
(- x (/ t_1 (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y - z);
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -2e+230) || !(t_2 <= 5e+281)) {
tmp = x + ((z - y) / ((z - a) / t));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (y - z)
t_2 = t_1 / (a - z)
if ((t_2 <= (-2d+230)) .or. (.not. (t_2 <= 5d+281))) then
tmp = x + ((z - y) / ((z - a) / t))
else
tmp = x - (t_1 / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y - z);
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -2e+230) || !(t_2 <= 5e+281)) {
tmp = x + ((z - y) / ((z - a) / t));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y - z) t_2 = t_1 / (a - z) tmp = 0 if (t_2 <= -2e+230) or not (t_2 <= 5e+281): tmp = x + ((z - y) / ((z - a) / t)) else: tmp = x - (t_1 / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y - z)) t_2 = Float64(t_1 / Float64(a - z)) tmp = 0.0 if ((t_2 <= -2e+230) || !(t_2 <= 5e+281)) tmp = Float64(x + Float64(Float64(z - y) / Float64(Float64(z - a) / t))); else tmp = Float64(x - Float64(t_1 / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y - z); t_2 = t_1 / (a - z); tmp = 0.0; if ((t_2 <= -2e+230) || ~((t_2 <= 5e+281))) tmp = x + ((z - y) / ((z - a) / t)); else tmp = x - (t_1 / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+230], N[Not[LessEqual[t$95$2, 5e+281]], $MachinePrecision]], N[(x + N[(N[(z - y), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(y - z\right)\\
t_2 := \frac{t\_1}{a - z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+230} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+281}\right):\\
\;\;\;\;x + \frac{z - y}{\frac{z - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -2.0000000000000002e230 or 5.00000000000000016e281 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 43.5%
associate-/l*99.8%
Simplified99.8%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
if -2.0000000000000002e230 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.00000000000000016e281Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (fma t (/ (- y z) (- a z)) x))
double code(double x, double y, double z, double t, double a) {
return fma(t, ((y - z) / (a - z)), x);
}
function code(x, y, z, t, a) return fma(t, Float64(Float64(y - z) / Float64(a - z)), x) end
code[x_, y_, z_, t_, a_] := N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t, \frac{y - z}{a - z}, x\right)
\end{array}
Initial program 85.6%
+-commutative85.6%
*-commutative85.6%
associate-/l*99.2%
fma-define99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (- y z))) (t_2 (/ t_1 (- a z))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+281)))
(+ x (* (- y z) (/ t (- a z))))
(- x (/ t_1 (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y - z);
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+281)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y - z);
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+281)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y - z) t_2 = t_1 / (a - z) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+281): tmp = x + ((y - z) * (t / (a - z))) else: tmp = x - (t_1 / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y - z)) t_2 = Float64(t_1 / Float64(a - z)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+281)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(t_1 / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y - z); t_2 = t_1 / (a - z); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+281))) tmp = x + ((y - z) * (t / (a - z))); else tmp = x - (t_1 / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+281]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(y - z\right)\\
t_2 := \frac{t\_1}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 5 \cdot 10^{+281}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 5.00000000000000016e281 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 40.8%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 5.00000000000000016e281Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-26) (not (<= z 3.4e+67))) (+ t x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-26) || !(z <= 3.4e+67)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.9d-26)) .or. (.not. (z <= 3.4d+67))) then
tmp = t + x
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-26) || !(z <= 3.4e+67)) {
tmp = t + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e-26) or not (z <= 3.4e+67): tmp = t + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e-26) || !(z <= 3.4e+67)) tmp = Float64(t + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e-26) || ~((z <= 3.4e+67))) tmp = t + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e-26], N[Not[LessEqual[z, 3.4e+67]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-26} \lor \neg \left(z \leq 3.4 \cdot 10^{+67}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.90000000000000007e-26 or 3.4000000000000002e67 < z Initial program 71.3%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 78.4%
if -1.90000000000000007e-26 < z < 3.4000000000000002e67Initial program 96.7%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around inf 85.6%
associate-*l/86.3%
*-commutative86.3%
Simplified86.3%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e-26) (not (<= z 5.6e+19))) (- x (* t (+ (/ y z) -1.0))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-26) || !(z <= 5.6e+19)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.9d-26)) .or. (.not. (z <= 5.6d+19))) then
tmp = x - (t * ((y / z) + (-1.0d0)))
else
tmp = x + (y * (t / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e-26) || !(z <= 5.6e+19)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e-26) or not (z <= 5.6e+19): tmp = x - (t * ((y / z) + -1.0)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e-26) || !(z <= 5.6e+19)) tmp = Float64(x - Float64(t * Float64(Float64(y / z) + -1.0))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e-26) || ~((z <= 5.6e+19))) tmp = x - (t * ((y / z) + -1.0)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e-26], N[Not[LessEqual[z, 5.6e+19]], $MachinePrecision]], N[(x - N[(t * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-26} \lor \neg \left(z \leq 5.6 \cdot 10^{+19}\right):\\
\;\;\;\;x - t \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.90000000000000007e-26 or 5.6e19 < z Initial program 74.7%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in a around 0 63.5%
mul-1-neg63.5%
unsub-neg63.5%
associate-/l*85.8%
div-sub85.8%
sub-neg85.8%
*-inverses85.8%
metadata-eval85.8%
Simplified85.8%
if -1.90000000000000007e-26 < z < 5.6e19Initial program 96.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around inf 88.8%
associate-*l/89.5%
*-commutative89.5%
Simplified89.5%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.25e-54) (not (<= y 1.65e+97))) (+ x (* y (/ t (- a z)))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.25e-54) || !(y <= 1.65e+97)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.25d-54)) .or. (.not. (y <= 1.65d+97))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (t * (z / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.25e-54) || !(y <= 1.65e+97)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.25e-54) or not (y <= 1.65e+97): tmp = x + (y * (t / (a - z))) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.25e-54) || !(y <= 1.65e+97)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.25e-54) || ~((y <= 1.65e+97))) tmp = x + (y * (t / (a - z))); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.25e-54], N[Not[LessEqual[y, 1.65e+97]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-54} \lor \neg \left(y \leq 1.65 \cdot 10^{+97}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -1.25000000000000004e-54 or 1.6500000000000001e97 < y Initial program 83.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around inf 82.1%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
if -1.25000000000000004e-54 < y < 1.6500000000000001e97Initial program 87.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 78.1%
mul-1-neg78.1%
unsub-neg78.1%
associate-/l*89.8%
Simplified89.8%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.05e-55) (not (<= y 3.8e+97))) (+ x (* y (/ t (- a z)))) (- x (/ t (/ (- a z) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e-55) || !(y <= 3.8e+97)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (t / ((a - z) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.05d-55)) .or. (.not. (y <= 3.8d+97))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x - (t / ((a - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e-55) || !(y <= 3.8e+97)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (t / ((a - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.05e-55) or not (y <= 3.8e+97): tmp = x + (y * (t / (a - z))) else: tmp = x - (t / ((a - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.05e-55) || !(y <= 3.8e+97)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(t / Float64(Float64(a - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.05e-55) || ~((y <= 3.8e+97))) tmp = x + (y * (t / (a - z))); else tmp = x - (t / ((a - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.05e-55], N[Not[LessEqual[y, 3.8e+97]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-55} \lor \neg \left(y \leq 3.8 \cdot 10^{+97}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a - z}{z}}\\
\end{array}
\end{array}
if y < -1.0500000000000001e-55 or 3.80000000000000036e97 < y Initial program 83.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around inf 82.1%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
if -1.0500000000000001e-55 < y < 3.80000000000000036e97Initial program 87.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 78.1%
mul-1-neg78.1%
unsub-neg78.1%
associate-/l*89.8%
Simplified89.8%
clear-num89.8%
un-div-inv89.8%
Applied egg-rr89.8%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e-26) (not (<= z 1.6e+18))) (+ t x) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e-26) || !(z <= 1.6e+18)) {
tmp = t + x;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.25d-26)) .or. (.not. (z <= 1.6d+18))) then
tmp = t + x
else
tmp = x + ((t * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e-26) || !(z <= 1.6e+18)) {
tmp = t + x;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e-26) or not (z <= 1.6e+18): tmp = t + x else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.25e-26) || !(z <= 1.6e+18)) tmp = Float64(t + x); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.25e-26) || ~((z <= 1.6e+18))) tmp = t + x; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.25e-26], N[Not[LessEqual[z, 1.6e+18]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-26} \lor \neg \left(z \leq 1.6 \cdot 10^{+18}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -1.25000000000000005e-26 or 1.6e18 < z Initial program 74.7%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 74.9%
if -1.25000000000000005e-26 < z < 1.6e18Initial program 96.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 79.8%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e-26) (not (<= z 4.8e+19))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e-26) || !(z <= 4.8e+19)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.7d-26)) .or. (.not. (z <= 4.8d+19))) then
tmp = t + x
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e-26) || !(z <= 4.8e+19)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e-26) or not (z <= 4.8e+19): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e-26) || !(z <= 4.8e+19)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e-26) || ~((z <= 4.8e+19))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e-26], N[Not[LessEqual[z, 4.8e+19]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-26} \lor \neg \left(z \leq 4.8 \cdot 10^{+19}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.70000000000000007e-26 or 4.8e19 < z Initial program 74.7%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 74.9%
if -1.70000000000000007e-26 < z < 4.8e19Initial program 96.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 79.8%
+-commutative79.8%
associate-/l*82.7%
Simplified82.7%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e-27) (not (<= z 1.15e+19))) (+ t x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e-27) || !(z <= 1.15e+19)) {
tmp = t + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.8d-27)) .or. (.not. (z <= 1.15d+19))) then
tmp = t + x
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e-27) || !(z <= 1.15e+19)) {
tmp = t + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e-27) or not (z <= 1.15e+19): tmp = t + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e-27) || !(z <= 1.15e+19)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e-27) || ~((z <= 1.15e+19))) tmp = t + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e-27], N[Not[LessEqual[z, 1.15e+19]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-27} \lor \neg \left(z \leq 1.15 \cdot 10^{+19}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -5.80000000000000008e-27 or 1.15e19 < z Initial program 74.7%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 74.9%
if -5.80000000000000008e-27 < z < 1.15e19Initial program 96.3%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 79.8%
+-commutative79.8%
associate-/l*82.7%
Simplified82.7%
clear-num82.6%
un-div-inv82.9%
Applied egg-rr82.9%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.2e-27) (not (<= z 4.2e-42))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.2e-27) || !(z <= 4.2e-42)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-6.2d-27)) .or. (.not. (z <= 4.2d-42))) then
tmp = t + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.2e-27) || !(z <= 4.2e-42)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.2e-27) or not (z <= 4.2e-42): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.2e-27) || !(z <= 4.2e-42)) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.2e-27) || ~((z <= 4.2e-42))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.2e-27], N[Not[LessEqual[z, 4.2e-42]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-27} \lor \neg \left(z \leq 4.2 \cdot 10^{-42}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.1999999999999997e-27 or 4.20000000000000013e-42 < z Initial program 75.7%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 71.0%
if -6.1999999999999997e-27 < z < 4.20000000000000013e-42Initial program 97.5%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in x around inf 50.4%
Final simplification61.6%
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ t (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y - z) * (t / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * (t / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (t / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 85.6%
associate-/l*95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.6%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in x around inf 47.4%
Final simplification47.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024046
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))