
(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 13 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 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
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 + (((z - t) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 85.0%
*-commutative85.0%
associate-*l/98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- z t) y) (- z a))))
(if (or (<= t_1 -10000000000.0) (not (<= t_1 1e+43)))
(* (/ (- z t) (- z a)) y)
(+ x (* z (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (z - a);
double tmp;
if ((t_1 <= -10000000000.0) || !(t_1 <= 1e+43)) {
tmp = ((z - t) / (z - a)) * y;
} else {
tmp = x + (z * (y / (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) :: tmp
t_1 = ((z - t) * y) / (z - a)
if ((t_1 <= (-10000000000.0d0)) .or. (.not. (t_1 <= 1d+43))) then
tmp = ((z - t) / (z - a)) * y
else
tmp = x + (z * (y / (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 = ((z - t) * y) / (z - a);
double tmp;
if ((t_1 <= -10000000000.0) || !(t_1 <= 1e+43)) {
tmp = ((z - t) / (z - a)) * y;
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / (z - a) tmp = 0 if (t_1 <= -10000000000.0) or not (t_1 <= 1e+43): tmp = ((z - t) / (z - a)) * y else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -10000000000.0) || !(t_1 <= 1e+43)) tmp = Float64(Float64(Float64(z - t) / Float64(z - a)) * y); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / (z - a); tmp = 0.0; if ((t_1 <= -10000000000.0) || ~((t_1 <= 1e+43))) tmp = ((z - t) / (z - a)) * y; else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -10000000000.0], N[Not[LessEqual[t$95$1, 1e+43]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{z - a}\\
\mathbf{if}\;t_1 \leq -10000000000 \lor \neg \left(t_1 \leq 10^{+43}\right):\\
\;\;\;\;\frac{z - t}{z - a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -1e10 or 1.00000000000000001e43 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 68.3%
Taylor expanded in x around 0 60.7%
*-commutative68.3%
associate-*l/97.4%
Applied egg-rr84.6%
if -1e10 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.00000000000000001e43Initial program 99.5%
Taylor expanded in t around 0 90.5%
+-commutative90.5%
associate-*l/88.4%
*-commutative88.4%
Simplified88.4%
Final simplification86.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (- z t) (/ z y)))))
(if (<= z -1.35e+60)
t_1
(if (<= z -3.2e+14)
x
(if (<= z -4.5e-29)
(* (/ (- z t) (- z a)) y)
(if (<= z 2.5e-18) (+ x (/ t (/ a y))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z - t) / (z / y));
double tmp;
if (z <= -1.35e+60) {
tmp = t_1;
} else if (z <= -3.2e+14) {
tmp = x;
} else if (z <= -4.5e-29) {
tmp = ((z - t) / (z - a)) * y;
} else if (z <= 2.5e-18) {
tmp = x + (t / (a / y));
} 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 + ((z - t) / (z / y))
if (z <= (-1.35d+60)) then
tmp = t_1
else if (z <= (-3.2d+14)) then
tmp = x
else if (z <= (-4.5d-29)) then
tmp = ((z - t) / (z - a)) * y
else if (z <= 2.5d-18) then
tmp = x + (t / (a / y))
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 + ((z - t) / (z / y));
double tmp;
if (z <= -1.35e+60) {
tmp = t_1;
} else if (z <= -3.2e+14) {
tmp = x;
} else if (z <= -4.5e-29) {
tmp = ((z - t) / (z - a)) * y;
} else if (z <= 2.5e-18) {
tmp = x + (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((z - t) / (z / y)) tmp = 0 if z <= -1.35e+60: tmp = t_1 elif z <= -3.2e+14: tmp = x elif z <= -4.5e-29: tmp = ((z - t) / (z - a)) * y elif z <= 2.5e-18: tmp = x + (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(z - t) / Float64(z / y))) tmp = 0.0 if (z <= -1.35e+60) tmp = t_1; elseif (z <= -3.2e+14) tmp = x; elseif (z <= -4.5e-29) tmp = Float64(Float64(Float64(z - t) / Float64(z - a)) * y); elseif (z <= 2.5e-18) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((z - t) / (z / y)); tmp = 0.0; if (z <= -1.35e+60) tmp = t_1; elseif (z <= -3.2e+14) tmp = x; elseif (z <= -4.5e-29) tmp = ((z - t) / (z - a)) * y; elseif (z <= 2.5e-18) tmp = x + (t / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+60], t$95$1, If[LessEqual[z, -3.2e+14], x, If[LessEqual[z, -4.5e-29], N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.5e-18], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - t}{\frac{z}{y}}\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{z - t}{z - a} \cdot y\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-18}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.35e60 or 2.50000000000000018e-18 < z Initial program 72.9%
*-commutative72.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in z around inf 84.6%
if -1.35e60 < z < -3.2e14Initial program 100.0%
Taylor expanded in x around inf 91.8%
if -3.2e14 < z < -4.4999999999999998e-29Initial program 99.8%
Taylor expanded in x around 0 85.8%
*-commutative99.8%
associate-*l/99.6%
Applied egg-rr85.7%
if -4.4999999999999998e-29 < z < 2.50000000000000018e-18Initial program 94.1%
Taylor expanded in z around 0 78.6%
+-commutative78.6%
associate-/l*82.3%
Simplified82.3%
Final simplification83.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+118) (not (<= t 2.15e-16))) (- x (/ t (/ (- z a) y))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+118) || !(t <= 2.15e-16)) {
tmp = x - (t / ((z - a) / y));
} else {
tmp = x + (z * (y / (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 ((t <= (-1.05d+118)) .or. (.not. (t <= 2.15d-16))) then
tmp = x - (t / ((z - a) / y))
else
tmp = x + (z * (y / (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 ((t <= -1.05e+118) || !(t <= 2.15e-16)) {
tmp = x - (t / ((z - a) / y));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+118) or not (t <= 2.15e-16): tmp = x - (t / ((z - a) / y)) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+118) || !(t <= 2.15e-16)) tmp = Float64(x - Float64(t / Float64(Float64(z - a) / y))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+118) || ~((t <= 2.15e-16))) tmp = x - (t / ((z - a) / y)); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+118], N[Not[LessEqual[t, 2.15e-16]], $MachinePrecision]], N[(x - N[(t / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+118} \lor \neg \left(t \leq 2.15 \cdot 10^{-16}\right):\\
\;\;\;\;x - \frac{t}{\frac{z - a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -1.05e118 or 2.1499999999999999e-16 < t Initial program 81.6%
*-commutative81.6%
associate-*l/98.0%
Applied egg-rr98.0%
Taylor expanded in t around inf 81.7%
mul-1-neg81.7%
associate-/l*92.7%
Simplified92.7%
if -1.05e118 < t < 2.1499999999999999e-16Initial program 87.3%
Taylor expanded in t around 0 78.3%
+-commutative78.3%
associate-*l/88.1%
*-commutative88.1%
Simplified88.1%
Final simplification89.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- z a))))
(if (<= t -1.05e+118)
(- x (/ t (/ (- z a) y)))
(if (<= t 2.2e-16) (+ x (* z t_1)) (- x (* t t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (z - a);
double tmp;
if (t <= -1.05e+118) {
tmp = x - (t / ((z - a) / y));
} else if (t <= 2.2e-16) {
tmp = x + (z * t_1);
} else {
tmp = x - (t * 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 = y / (z - a)
if (t <= (-1.05d+118)) then
tmp = x - (t / ((z - a) / y))
else if (t <= 2.2d-16) then
tmp = x + (z * t_1)
else
tmp = x - (t * 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 = y / (z - a);
double tmp;
if (t <= -1.05e+118) {
tmp = x - (t / ((z - a) / y));
} else if (t <= 2.2e-16) {
tmp = x + (z * t_1);
} else {
tmp = x - (t * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (z - a) tmp = 0 if t <= -1.05e+118: tmp = x - (t / ((z - a) / y)) elif t <= 2.2e-16: tmp = x + (z * t_1) else: tmp = x - (t * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(z - a)) tmp = 0.0 if (t <= -1.05e+118) tmp = Float64(x - Float64(t / Float64(Float64(z - a) / y))); elseif (t <= 2.2e-16) tmp = Float64(x + Float64(z * t_1)); else tmp = Float64(x - Float64(t * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (z - a); tmp = 0.0; if (t <= -1.05e+118) tmp = x - (t / ((z - a) / y)); elseif (t <= 2.2e-16) tmp = x + (z * t_1); else tmp = x - (t * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+118], N[(x - N[(t / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e-16], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z - a}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+118}:\\
\;\;\;\;x - \frac{t}{\frac{z - a}{y}}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-16}:\\
\;\;\;\;x + z \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot t_1\\
\end{array}
\end{array}
if t < -1.05e118Initial program 77.2%
*-commutative77.2%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 77.2%
mul-1-neg77.2%
associate-/l*93.4%
Simplified93.4%
if -1.05e118 < t < 2.2e-16Initial program 87.3%
Taylor expanded in t around 0 78.3%
+-commutative78.3%
associate-*l/88.1%
*-commutative88.1%
Simplified88.1%
if 2.2e-16 < t Initial program 83.3%
Taylor expanded in t around inf 83.5%
associate-*r/93.6%
neg-mul-193.6%
distribute-rgt-neg-in93.6%
distribute-neg-frac93.6%
Simplified93.6%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.8e+63) (not (<= z 5e-15))) (+ x y) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.8e+63) || !(z <= 5e-15)) {
tmp = x + y;
} 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 <= (-9.8d+63)) .or. (.not. (z <= 5d-15))) then
tmp = x + y
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 <= -9.8e+63) || !(z <= 5e-15)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.8e+63) or not (z <= 5e-15): tmp = x + y else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.8e+63) || !(z <= 5e-15)) tmp = Float64(x + y); 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 <= -9.8e+63) || ~((z <= 5e-15))) tmp = x + y; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.8e+63], N[Not[LessEqual[z, 5e-15]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+63} \lor \neg \left(z \leq 5 \cdot 10^{-15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -9.7999999999999994e63 or 4.99999999999999999e-15 < z Initial program 73.5%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -9.7999999999999994e63 < z < 4.99999999999999999e-15Initial program 94.3%
Taylor expanded in z around 0 75.6%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.25e+64) (not (<= z 7.5e-13))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e+64) || !(z <= 7.5e-13)) {
tmp = x + y;
} 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 <= (-1.25d+64)) .or. (.not. (z <= 7.5d-13))) then
tmp = x + y
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 <= -1.25e+64) || !(z <= 7.5e-13)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e+64) or not (z <= 7.5e-13): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.25e+64) || !(z <= 7.5e-13)) tmp = Float64(x + y); 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 <= -1.25e+64) || ~((z <= 7.5e-13))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.25e+64], N[Not[LessEqual[z, 7.5e-13]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+64} \lor \neg \left(z \leq 7.5 \cdot 10^{-13}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.25e64 or 7.5000000000000004e-13 < z Initial program 73.5%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -1.25e64 < z < 7.5000000000000004e-13Initial program 94.3%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
associate-/l*78.8%
Simplified78.8%
associate-/r/33.6%
Applied egg-rr78.5%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+63) (not (<= z 1.65e-15))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+63) || !(z <= 1.65e-15)) {
tmp = x + y;
} 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 <= (-8.2d+63)) .or. (.not. (z <= 1.65d-15))) then
tmp = x + y
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 <= -8.2e+63) || !(z <= 1.65e-15)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+63) or not (z <= 1.65e-15): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+63) || !(z <= 1.65e-15)) tmp = Float64(x + y); 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 <= -8.2e+63) || ~((z <= 1.65e-15))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+63], N[Not[LessEqual[z, 1.65e-15]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+63} \lor \neg \left(z \leq 1.65 \cdot 10^{-15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -8.19999999999999985e63 or 1.65e-15 < z Initial program 73.5%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -8.19999999999999985e63 < z < 1.65e-15Initial program 94.3%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
associate-/l*78.8%
Simplified78.8%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2e+136) (not (<= t 7.2e+195))) (* y (/ t a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+136) || !(t <= 7.2e+195)) {
tmp = y * (t / a);
} else {
tmp = x + 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 ((t <= (-2d+136)) .or. (.not. (t <= 7.2d+195))) then
tmp = y * (t / a)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+136) || !(t <= 7.2e+195)) {
tmp = y * (t / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2e+136) or not (t <= 7.2e+195): tmp = y * (t / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2e+136) || !(t <= 7.2e+195)) tmp = Float64(y * Float64(t / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2e+136) || ~((t <= 7.2e+195))) tmp = y * (t / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2e+136], N[Not[LessEqual[t, 7.2e+195]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+136} \lor \neg \left(t \leq 7.2 \cdot 10^{+195}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.00000000000000012e136 or 7.1999999999999997e195 < t Initial program 79.6%
Taylor expanded in x around 0 60.2%
Taylor expanded in z around 0 42.9%
associate-/l*50.8%
Simplified50.8%
associate-/r/52.2%
Applied egg-rr52.2%
if -2.00000000000000012e136 < t < 7.1999999999999997e195Initial program 86.4%
Taylor expanded in z around inf 66.1%
+-commutative66.1%
Simplified66.1%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.5e+135) (* y (/ t a)) (if (<= t 1.7e+196) (+ x y) (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+135) {
tmp = y * (t / a);
} else if (t <= 1.7e+196) {
tmp = x + y;
} else {
tmp = 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 (t <= (-5.5d+135)) then
tmp = y * (t / a)
else if (t <= 1.7d+196) then
tmp = x + y
else
tmp = 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 (t <= -5.5e+135) {
tmp = y * (t / a);
} else if (t <= 1.7e+196) {
tmp = x + y;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+135: tmp = y * (t / a) elif t <= 1.7e+196: tmp = x + y else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+135) tmp = Float64(y * Float64(t / a)); elseif (t <= 1.7e+196) tmp = Float64(x + y); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+135) tmp = y * (t / a); elseif (t <= 1.7e+196) tmp = x + y; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+135], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+196], N[(x + y), $MachinePrecision], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+135}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+196}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -5.4999999999999999e135Initial program 73.6%
Taylor expanded in x around 0 57.1%
Taylor expanded in z around 0 41.6%
associate-/l*50.2%
Simplified50.2%
associate-/r/52.9%
Applied egg-rr52.9%
if -5.4999999999999999e135 < t < 1.7e196Initial program 86.4%
Taylor expanded in z around inf 66.1%
+-commutative66.1%
Simplified66.1%
if 1.7e196 < t Initial program 85.4%
Taylor expanded in x around 0 63.2%
Taylor expanded in z around 0 44.1%
associate-/l*51.5%
Simplified51.5%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+63) (not (<= z 1.52e-22))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+63) || !(z <= 1.52e-22)) {
tmp = x + 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 ((z <= (-8.2d+63)) .or. (.not. (z <= 1.52d-22))) then
tmp = x + 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 ((z <= -8.2e+63) || !(z <= 1.52e-22)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+63) or not (z <= 1.52e-22): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+63) || !(z <= 1.52e-22)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.2e+63) || ~((z <= 1.52e-22))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+63], N[Not[LessEqual[z, 1.52e-22]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+63} \lor \neg \left(z \leq 1.52 \cdot 10^{-22}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.19999999999999985e63 or 1.52000000000000005e-22 < z Initial program 72.9%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -8.19999999999999985e63 < z < 1.52000000000000005e-22Initial program 94.9%
Taylor expanded in x around inf 49.4%
Final simplification61.1%
(FPCore (x y z t a) :precision binary64 (if (<= y 4.2e+96) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.2e+96) {
tmp = x;
} else {
tmp = 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 (y <= 4.2d+96) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.2e+96) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 4.2e+96: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 4.2e+96) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 4.2e+96) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.2e+96], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 4.2000000000000002e96Initial program 89.4%
Taylor expanded in x around inf 58.1%
if 4.2000000000000002e96 < y Initial program 68.7%
Taylor expanded in x around 0 58.7%
Taylor expanded in z around inf 30.2%
Final simplification52.2%
(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.0%
Taylor expanded in x around inf 48.1%
Final simplification48.1%
(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 2024019
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))