
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))) (t_2 (/ t_1 (- z a))))
(if (or (<= t_2 -5e+221) (not (<= t_2 5e+228)))
(+ x (/ -1.0 (/ (/ (- z a) y) (- t z))))
(- x (/ t_1 (- a z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if ((t_2 <= -5e+221) || !(t_2 <= 5e+228)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else {
tmp = x - (t_1 / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (z - t)
t_2 = t_1 / (z - a)
if ((t_2 <= (-5d+221)) .or. (.not. (t_2 <= 5d+228))) then
tmp = x + ((-1.0d0) / (((z - a) / y) / (t - z)))
else
tmp = x - (t_1 / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if ((t_2 <= -5e+221) || !(t_2 <= 5e+228)) {
tmp = x + (-1.0 / (((z - a) / y) / (t - z)));
} else {
tmp = x - (t_1 / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) t_2 = t_1 / (z - a) tmp = 0 if (t_2 <= -5e+221) or not (t_2 <= 5e+228): tmp = x + (-1.0 / (((z - a) / y) / (t - z))) else: tmp = x - (t_1 / (a - z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) t_2 = Float64(t_1 / Float64(z - a)) tmp = 0.0 if ((t_2 <= -5e+221) || !(t_2 <= 5e+228)) tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(z - a) / y) / Float64(t - z)))); else tmp = Float64(x - Float64(t_1 / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); t_2 = t_1 / (z - a); tmp = 0.0; if ((t_2 <= -5e+221) || ~((t_2 <= 5e+228))) tmp = x + (-1.0 / (((z - a) / y) / (t - z))); else tmp = x - (t_1 / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+221], N[Not[LessEqual[t$95$2, 5e+228]], $MachinePrecision]], N[(x + N[(-1.0 / N[(N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
t_2 := \frac{t\_1}{z - a}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+221} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+228}\right):\\
\;\;\;\;x + \frac{-1}{\frac{\frac{z - a}{y}}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.0000000000000002e221 or 5e228 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 45.6%
clear-num45.6%
inv-pow45.6%
Applied egg-rr45.6%
unpow-145.6%
associate-/r*99.7%
Simplified99.7%
if -5.0000000000000002e221 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5e228Initial program 99.9%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 83.7%
+-commutative83.7%
associate-/l*99.2%
fma-define99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- z t))) (t_2 (/ t_1 (- z a))))
(if (<= t_2 (- INFINITY))
(* (- z t) (/ y (- z a)))
(if (<= t_2 1e+233) (- x (/ t_1 (- a z))) (/ (- z t) (/ (- z a) y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z - t) * (y / (z - a));
} else if (t_2 <= 1e+233) {
tmp = x - (t_1 / (a - z));
} else {
tmp = (z - t) / ((z - a) / y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double t_2 = t_1 / (z - a);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (z - t) * (y / (z - a));
} else if (t_2 <= 1e+233) {
tmp = x - (t_1 / (a - z));
} else {
tmp = (z - t) / ((z - a) / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) t_2 = t_1 / (z - a) tmp = 0 if t_2 <= -math.inf: tmp = (z - t) * (y / (z - a)) elif t_2 <= 1e+233: tmp = x - (t_1 / (a - z)) else: tmp = (z - t) / ((z - a) / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) t_2 = Float64(t_1 / Float64(z - a)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif (t_2 <= 1e+233) tmp = Float64(x - Float64(t_1 / Float64(a - z))); else tmp = Float64(Float64(z - t) / Float64(Float64(z - a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); t_2 = t_1 / (z - a); tmp = 0.0; if (t_2 <= -Inf) tmp = (z - t) * (y / (z - a)); elseif (t_2 <= 1e+233) tmp = x - (t_1 / (a - z)); else tmp = (z - t) / ((z - a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+233], N[(x - N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
t_2 := \frac{t\_1}{z - a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t\_2 \leq 10^{+233}:\\
\;\;\;\;x - \frac{t\_1}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - t}{\frac{z - a}{y}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 40.5%
Taylor expanded in x around 0 40.5%
associate-*l/84.6%
Simplified84.6%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999974e232Initial program 99.8%
if 9.99999999999999974e232 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 43.4%
Taylor expanded in x around 0 43.4%
associate-*l/88.2%
Simplified88.2%
clear-num88.1%
associate-/r/88.1%
clear-num88.3%
Applied egg-rr88.3%
Final simplification96.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- z t) (/ y (- z a)))))
(if (<= z -5.1e+41)
(+ y x)
(if (<= z -2.45e-39)
t_1
(if (<= z -4e-67)
(+ y x)
(if (<= z 1.25e-24)
(+ x (/ (* y t) a))
(if (<= z 1.65e+61) t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (z - a));
double tmp;
if (z <= -5.1e+41) {
tmp = y + x;
} else if (z <= -2.45e-39) {
tmp = t_1;
} else if (z <= -4e-67) {
tmp = y + x;
} else if (z <= 1.25e-24) {
tmp = x + ((y * t) / a);
} else if (z <= 1.65e+61) {
tmp = t_1;
} else {
tmp = y + 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) :: t_1
real(8) :: tmp
t_1 = (z - t) * (y / (z - a))
if (z <= (-5.1d+41)) then
tmp = y + x
else if (z <= (-2.45d-39)) then
tmp = t_1
else if (z <= (-4d-67)) then
tmp = y + x
else if (z <= 1.25d-24) then
tmp = x + ((y * t) / a)
else if (z <= 1.65d+61) then
tmp = t_1
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / (z - a));
double tmp;
if (z <= -5.1e+41) {
tmp = y + x;
} else if (z <= -2.45e-39) {
tmp = t_1;
} else if (z <= -4e-67) {
tmp = y + x;
} else if (z <= 1.25e-24) {
tmp = x + ((y * t) / a);
} else if (z <= 1.65e+61) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * (y / (z - a)) tmp = 0 if z <= -5.1e+41: tmp = y + x elif z <= -2.45e-39: tmp = t_1 elif z <= -4e-67: tmp = y + x elif z <= 1.25e-24: tmp = x + ((y * t) / a) elif z <= 1.65e+61: tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * Float64(y / Float64(z - a))) tmp = 0.0 if (z <= -5.1e+41) tmp = Float64(y + x); elseif (z <= -2.45e-39) tmp = t_1; elseif (z <= -4e-67) tmp = Float64(y + x); elseif (z <= 1.25e-24) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (z <= 1.65e+61) tmp = t_1; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * (y / (z - a)); tmp = 0.0; if (z <= -5.1e+41) tmp = y + x; elseif (z <= -2.45e-39) tmp = t_1; elseif (z <= -4e-67) tmp = y + x; elseif (z <= 1.25e-24) tmp = x + ((y * t) / a); elseif (z <= 1.65e+61) tmp = t_1; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.1e+41], N[(y + x), $MachinePrecision], If[LessEqual[z, -2.45e-39], t$95$1, If[LessEqual[z, -4e-67], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.25e-24], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+61], t$95$1, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{+41}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-67}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-24}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.09999999999999978e41 or -2.44999999999999987e-39 < z < -3.99999999999999977e-67 or 1.6499999999999999e61 < z Initial program 64.9%
Taylor expanded in z around inf 79.7%
+-commutative79.7%
Simplified79.7%
if -5.09999999999999978e41 < z < -2.44999999999999987e-39 or 1.24999999999999995e-24 < z < 1.6499999999999999e61Initial program 94.7%
Taylor expanded in x around 0 67.8%
associate-*l/72.9%
Simplified72.9%
if -3.99999999999999977e-67 < z < 1.24999999999999995e-24Initial program 99.1%
Taylor expanded in z around 0 84.8%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e-88) (not (<= z 3.6e-22))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e-88) || !(z <= 3.6e-22)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
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.5d-88)) .or. (.not. (z <= 3.6d-22))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + (y / (a / t))
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.5e-88) || !(z <= 3.6e-22)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e-88) or not (z <= 3.6e-22): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e-88) || !(z <= 3.6e-22)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.5e-88) || ~((z <= 3.6e-22))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e-88], N[Not[LessEqual[z, 3.6e-22]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-88} \lor \neg \left(z \leq 3.6 \cdot 10^{-22}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.5e-88 or 3.5999999999999998e-22 < z Initial program 73.7%
Taylor expanded in a around 0 61.9%
+-commutative61.9%
associate-/l*83.5%
Simplified83.5%
if -1.5e-88 < z < 3.5999999999999998e-22Initial program 98.1%
Taylor expanded in z around 0 85.1%
*-commutative85.1%
associate-/l*85.1%
Applied egg-rr85.1%
clear-num85.1%
un-div-inv85.1%
Applied egg-rr85.1%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+149) (not (<= z 3.5e+70))) (+ x (* y (/ (- z t) z))) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+149) || !(z <= 3.5e+70)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - (y * (t / (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 ((z <= (-3.7d+149)) .or. (.not. (z <= 3.5d+70))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x - (y * (t / (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 ((z <= -3.7e+149) || !(z <= 3.5e+70)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+149) or not (z <= 3.5e+70): tmp = x + (y * ((z - t) / z)) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+149) || !(z <= 3.5e+70)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.7e+149) || ~((z <= 3.5e+70))) tmp = x + (y * ((z - t) / z)); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+149], N[Not[LessEqual[z, 3.5e+70]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+149} \lor \neg \left(z \leq 3.5 \cdot 10^{+70}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -3.69999999999999978e149 or 3.50000000000000002e70 < z Initial program 59.4%
Taylor expanded in a around 0 56.7%
+-commutative56.7%
associate-/l*94.2%
Simplified94.2%
if -3.69999999999999978e149 < z < 3.50000000000000002e70Initial program 95.0%
Taylor expanded in t around inf 83.6%
associate-*r/83.6%
mul-1-neg83.6%
distribute-lft-neg-out83.6%
*-commutative83.6%
Simplified83.6%
associate-/l*85.7%
add-sqr-sqrt45.8%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod26.9%
add-sqr-sqrt53.2%
cancel-sign-sub-inv53.2%
add-sqr-sqrt19.6%
sqrt-unprod58.6%
sqr-neg58.6%
sqrt-unprod49.0%
add-sqr-sqrt85.7%
Applied egg-rr85.7%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.35e-67) (not (<= z 7.2e+76))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.35e-67) || !(z <= 7.2e+76)) {
tmp = y + x;
} else {
tmp = x + (y * (t / 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 <= (-2.35d-67)) .or. (.not. (z <= 7.2d+76))) then
tmp = y + x
else
tmp = x + (y * (t / 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 <= -2.35e-67) || !(z <= 7.2e+76)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.35e-67) or not (z <= 7.2e+76): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.35e-67) || !(z <= 7.2e+76)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.35e-67) || ~((z <= 7.2e+76))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.35e-67], N[Not[LessEqual[z, 7.2e+76]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-67} \lor \neg \left(z \leq 7.2 \cdot 10^{+76}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.35000000000000002e-67 or 7.2000000000000006e76 < z Initial program 68.6%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -2.35000000000000002e-67 < z < 7.2000000000000006e76Initial program 96.5%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
associate-/l*77.8%
Applied egg-rr77.8%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8200000.0) (not (<= z 1.05e+77))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8200000.0) || !(z <= 1.05e+77)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
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 <= (-8200000.0d0)) .or. (.not. (z <= 1.05d+77))) then
tmp = y + x
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8200000.0) || !(z <= 1.05e+77)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8200000.0) or not (z <= 1.05e+77): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8200000.0) || !(z <= 1.05e+77)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8200000.0) || ~((z <= 1.05e+77))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8200000.0], N[Not[LessEqual[z, 1.05e+77]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8200000 \lor \neg \left(z \leq 1.05 \cdot 10^{+77}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -8.2e6 or 1.0499999999999999e77 < z Initial program 65.3%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -8.2e6 < z < 1.0499999999999999e77Initial program 96.8%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
associate-/l*75.7%
Applied egg-rr75.7%
clear-num75.7%
un-div-inv76.3%
Applied egg-rr76.3%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.4e-70) x (if (<= x 1.2e-149) (* y (/ (- z t) z)) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.4e-70) {
tmp = x;
} else if (x <= 1.2e-149) {
tmp = y * ((z - t) / z);
} else {
tmp = y + 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 (x <= (-4.4d-70)) then
tmp = x
else if (x <= 1.2d-149) then
tmp = y * ((z - t) / z)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.4e-70) {
tmp = x;
} else if (x <= 1.2e-149) {
tmp = y * ((z - t) / z);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.4e-70: tmp = x elif x <= 1.2e-149: tmp = y * ((z - t) / z) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.4e-70) tmp = x; elseif (x <= 1.2e-149) tmp = Float64(y * Float64(Float64(z - t) / z)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.4e-70) tmp = x; elseif (x <= 1.2e-149) tmp = y * ((z - t) / z); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.4e-70], x, If[LessEqual[x, 1.2e-149], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-149}:\\
\;\;\;\;y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if x < -4.3999999999999998e-70Initial program 90.0%
Taylor expanded in x around inf 74.5%
if -4.3999999999999998e-70 < x < 1.2000000000000001e-149Initial program 82.2%
Taylor expanded in x around 0 66.4%
associate-*l/74.1%
Simplified74.1%
Taylor expanded in z around inf 45.1%
Taylor expanded in y around 0 38.7%
associate-*r/52.6%
Simplified52.6%
if 1.2000000000000001e-149 < x Initial program 80.5%
Taylor expanded in z around inf 68.4%
+-commutative68.4%
Simplified68.4%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e-125) (not (<= z 1.75e-21))) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e-125) || !(z <= 1.75e-21)) {
tmp = y + 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 <= (-1.65d-125)) .or. (.not. (z <= 1.75d-21))) then
tmp = y + 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 <= -1.65e-125) || !(z <= 1.75e-21)) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e-125) or not (z <= 1.75e-21): tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e-125) || !(z <= 1.75e-21)) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e-125) || ~((z <= 1.75e-21))) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e-125], N[Not[LessEqual[z, 1.75e-21]], $MachinePrecision]], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-125} \lor \neg \left(z \leq 1.75 \cdot 10^{-21}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.65e-125 or 1.7500000000000002e-21 < z Initial program 74.9%
Taylor expanded in z around inf 68.9%
+-commutative68.9%
Simplified68.9%
if -1.65e-125 < z < 1.7500000000000002e-21Initial program 98.0%
Taylor expanded in x around inf 59.8%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.35e-116) x (if (<= x 8.2e-101) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.35e-116) {
tmp = x;
} else if (x <= 8.2e-101) {
tmp = y;
} 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 (x <= (-1.35d-116)) then
tmp = x
else if (x <= 8.2d-101) then
tmp = y
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 (x <= -1.35e-116) {
tmp = x;
} else if (x <= 8.2e-101) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.35e-116: tmp = x elif x <= 8.2e-101: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.35e-116) tmp = x; elseif (x <= 8.2e-101) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.35e-116) tmp = x; elseif (x <= 8.2e-101) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.35e-116], x, If[LessEqual[x, 8.2e-101], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-116}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-101}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.35e-116 or 8.20000000000000052e-101 < x Initial program 84.6%
Taylor expanded in x around inf 65.9%
if -1.35e-116 < x < 8.20000000000000052e-101Initial program 81.4%
Taylor expanded in x around 0 66.4%
associate-*l/73.0%
Simplified73.0%
Taylor expanded in z around inf 45.5%
Taylor expanded in z around inf 32.6%
Final simplification56.6%
(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 83.7%
Taylor expanded in x around inf 52.0%
Final simplification52.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024115
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))