
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(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(Float64(y / 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[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z - a} \cdot \left(z - t\right)
\end{array}
Initial program 97.0%
associate-*r/84.8%
Simplified84.8%
*-commutative84.8%
associate-/l*98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -12200000000000.0)
(+ x y)
(if (<= z 0.4)
(+ x (/ t (/ a y)))
(if (<= z 1.3e+130) (+ x (/ (* y (- z t)) z)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -12200000000000.0) {
tmp = x + y;
} else if (z <= 0.4) {
tmp = x + (t / (a / y));
} else if (z <= 1.3e+130) {
tmp = x + ((y * (z - t)) / z);
} 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 (z <= (-12200000000000.0d0)) then
tmp = x + y
else if (z <= 0.4d0) then
tmp = x + (t / (a / y))
else if (z <= 1.3d+130) then
tmp = x + ((y * (z - t)) / z)
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 (z <= -12200000000000.0) {
tmp = x + y;
} else if (z <= 0.4) {
tmp = x + (t / (a / y));
} else if (z <= 1.3e+130) {
tmp = x + ((y * (z - t)) / z);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -12200000000000.0: tmp = x + y elif z <= 0.4: tmp = x + (t / (a / y)) elif z <= 1.3e+130: tmp = x + ((y * (z - t)) / z) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -12200000000000.0) tmp = Float64(x + y); elseif (z <= 0.4) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 1.3e+130) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / z)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -12200000000000.0) tmp = x + y; elseif (z <= 0.4) tmp = x + (t / (a / y)); elseif (z <= 1.3e+130) tmp = x + ((y * (z - t)) / z); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -12200000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 0.4], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+130], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -12200000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 0.4:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+130}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.22e13 or 1.2999999999999999e130 < z Initial program 99.9%
Taylor expanded in z around inf 81.5%
+-commutative81.5%
Simplified81.5%
if -1.22e13 < z < 0.40000000000000002Initial program 94.2%
Taylor expanded in z around 0 82.3%
+-commutative82.3%
associate-/l*83.6%
Simplified83.6%
add083.6%
clear-num83.6%
un-div-inv83.8%
Applied egg-rr83.8%
add083.8%
Simplified83.8%
if 0.40000000000000002 < z < 1.2999999999999999e130Initial program 99.9%
Taylor expanded in a around 0 83.4%
Final simplification82.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -4.3e-72)
t_1
(if (<= z 0.4)
(+ x (/ t (/ a y)))
(if (<= z 2.2e+168) (+ x (* y (/ (- z t) z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -4.3e-72) {
tmp = t_1;
} else if (z <= 0.4) {
tmp = x + (t / (a / y));
} else if (z <= 2.2e+168) {
tmp = x + (y * ((z - t) / 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 / (z - a)))
if (z <= (-4.3d-72)) then
tmp = t_1
else if (z <= 0.4d0) then
tmp = x + (t / (a / y))
else if (z <= 2.2d+168) then
tmp = x + (y * ((z - t) / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -4.3e-72) {
tmp = t_1;
} else if (z <= 0.4) {
tmp = x + (t / (a / y));
} else if (z <= 2.2e+168) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -4.3e-72: tmp = t_1 elif z <= 0.4: tmp = x + (t / (a / y)) elif z <= 2.2e+168: tmp = x + (y * ((z - t) / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -4.3e-72) tmp = t_1; elseif (z <= 0.4) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 2.2e+168) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -4.3e-72) tmp = t_1; elseif (z <= 0.4) tmp = x + (t / (a / y)); elseif (z <= 2.2e+168) tmp = x + (y * ((z - t) / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e-72], t$95$1, If[LessEqual[z, 0.4], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+168], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.4:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+168}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.2999999999999999e-72 or 2.2000000000000002e168 < z Initial program 99.0%
Taylor expanded in t around 0 62.9%
+-commutative62.9%
associate-/l*89.7%
Simplified89.7%
if -4.2999999999999999e-72 < z < 0.40000000000000002Initial program 94.2%
Taylor expanded in z around 0 84.8%
+-commutative84.8%
associate-/l*87.2%
Simplified87.2%
add087.2%
clear-num87.2%
un-div-inv87.4%
Applied egg-rr87.4%
add087.4%
Simplified87.4%
if 0.40000000000000002 < z < 2.2000000000000002e168Initial program 100.0%
Taylor expanded in a around 0 77.7%
+-commutative77.7%
associate-/l*84.7%
Simplified84.7%
Final simplification87.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -3.8e-73)
t_1
(if (<= z 0.43)
(- x (* (/ y a) (- z t)))
(if (<= z 3.7e+167) (+ x (* y (/ (- z t) z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -3.8e-73) {
tmp = t_1;
} else if (z <= 0.43) {
tmp = x - ((y / a) * (z - t));
} else if (z <= 3.7e+167) {
tmp = x + (y * ((z - t) / 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 / (z - a)))
if (z <= (-3.8d-73)) then
tmp = t_1
else if (z <= 0.43d0) then
tmp = x - ((y / a) * (z - t))
else if (z <= 3.7d+167) then
tmp = x + (y * ((z - t) / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -3.8e-73) {
tmp = t_1;
} else if (z <= 0.43) {
tmp = x - ((y / a) * (z - t));
} else if (z <= 3.7e+167) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -3.8e-73: tmp = t_1 elif z <= 0.43: tmp = x - ((y / a) * (z - t)) elif z <= 3.7e+167: tmp = x + (y * ((z - t) / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -3.8e-73) tmp = t_1; elseif (z <= 0.43) tmp = Float64(x - Float64(Float64(y / a) * Float64(z - t))); elseif (z <= 3.7e+167) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -3.8e-73) tmp = t_1; elseif (z <= 0.43) tmp = x - ((y / a) * (z - t)); elseif (z <= 3.7e+167) tmp = x + (y * ((z - t) / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-73], t$95$1, If[LessEqual[z, 0.43], N[(x - N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+167], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.43:\\
\;\;\;\;x - \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+167}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8000000000000003e-73 or 3.7000000000000001e167 < z Initial program 99.0%
Taylor expanded in t around 0 62.9%
+-commutative62.9%
associate-/l*89.7%
Simplified89.7%
if -3.8000000000000003e-73 < z < 0.429999999999999993Initial program 94.2%
Taylor expanded in a around inf 86.8%
mul-1-neg86.8%
unsub-neg86.8%
associate-/l*85.1%
Simplified85.1%
clear-num85.1%
un-div-inv85.9%
Applied egg-rr85.9%
associate-/r/89.2%
Simplified89.2%
if 0.429999999999999993 < z < 3.7000000000000001e167Initial program 100.0%
Taylor expanded in a around 0 77.7%
+-commutative77.7%
associate-/l*84.7%
Simplified84.7%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e-72) (not (<= z 1.12e+19))) (+ x (* y (/ z (- z a)))) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-72) || !(z <= 1.12e+19)) {
tmp = x + (y * (z / (z - a)));
} 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 <= (-3.9d-72)) .or. (.not. (z <= 1.12d+19))) then
tmp = x + (y * (z / (z - a)))
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 <= -3.9e-72) || !(z <= 1.12e+19)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e-72) or not (z <= 1.12e+19): tmp = x + (y * (z / (z - a))) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e-72) || !(z <= 1.12e+19)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); 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 <= -3.9e-72) || ~((z <= 1.12e+19))) tmp = x + (y * (z / (z - a))); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e-72], N[Not[LessEqual[z, 1.12e+19]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-72} \lor \neg \left(z \leq 1.12 \cdot 10^{+19}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -3.9e-72 or 1.12e19 < z Initial program 99.3%
Taylor expanded in t around 0 65.2%
+-commutative65.2%
associate-/l*85.8%
Simplified85.8%
if -3.9e-72 < z < 1.12e19Initial program 94.5%
Taylor expanded in z around 0 83.2%
+-commutative83.2%
associate-/l*86.3%
Simplified86.3%
add086.3%
clear-num86.2%
un-div-inv86.5%
Applied egg-rr86.5%
add086.5%
Simplified86.5%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+54) (not (<= z 3.5e+67))) (+ x (* y (/ z (- z a)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+54) || !(z <= 3.5e+67)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / (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.1d+54)) .or. (.not. (z <= 3.5d+67))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (t * (y / (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.1e+54) || !(z <= 3.5e+67)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+54) or not (z <= 3.5e+67): tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+54) || !(z <= 3.5e+67)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+54) || ~((z <= 3.5e+67))) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+54], N[Not[LessEqual[z, 3.5e+67]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+54} \lor \neg \left(z \leq 3.5 \cdot 10^{+67}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.09999999999999995e54 or 3.5e67 < z Initial program 99.9%
Taylor expanded in t around 0 65.0%
+-commutative65.0%
associate-/l*94.1%
Simplified94.1%
if -1.09999999999999995e54 < z < 3.5e67Initial program 95.2%
Taylor expanded in t around inf 90.1%
mul-1-neg90.1%
associate-/l*91.8%
distribute-lft-neg-in91.8%
Simplified91.8%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -16000000000000.0) (not (<= z 1.45e+19))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -16000000000000.0) || !(z <= 1.45e+19)) {
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 <= (-16000000000000.0d0)) .or. (.not. (z <= 1.45d+19))) 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 <= -16000000000000.0) || !(z <= 1.45e+19)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -16000000000000.0) or not (z <= 1.45e+19): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -16000000000000.0) || !(z <= 1.45e+19)) 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 <= -16000000000000.0) || ~((z <= 1.45e+19))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -16000000000000.0], N[Not[LessEqual[z, 1.45e+19]], $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 -16000000000000 \lor \neg \left(z \leq 1.45 \cdot 10^{+19}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.6e13 or 1.45e19 < z Initial program 99.9%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -1.6e13 < z < 1.45e19Initial program 94.4%
Taylor expanded in z around 0 80.9%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -14000000000000.0) (not (<= z 7.5e+18))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -14000000000000.0) || !(z <= 7.5e+18)) {
tmp = x + y;
} 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 <= (-14000000000000.0d0)) .or. (.not. (z <= 7.5d+18))) then
tmp = x + y
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 <= -14000000000000.0) || !(z <= 7.5e+18)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -14000000000000.0) or not (z <= 7.5e+18): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -14000000000000.0) || !(z <= 7.5e+18)) tmp = Float64(x + y); 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 <= -14000000000000.0) || ~((z <= 7.5e+18))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -14000000000000.0], N[Not[LessEqual[z, 7.5e+18]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -14000000000000 \lor \neg \left(z \leq 7.5 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.4e13 or 7.5e18 < z Initial program 99.9%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -1.4e13 < z < 7.5e18Initial program 94.4%
clear-num94.4%
un-div-inv95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 81.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -12200000000000.0) (not (<= z 0.45))) (+ x y) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -12200000000000.0) || !(z <= 0.45)) {
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 <= (-12200000000000.0d0)) .or. (.not. (z <= 0.45d0))) 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 <= -12200000000000.0) || !(z <= 0.45)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -12200000000000.0) or not (z <= 0.45): tmp = x + y else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -12200000000000.0) || !(z <= 0.45)) 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 <= -12200000000000.0) || ~((z <= 0.45))) tmp = x + y; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -12200000000000.0], N[Not[LessEqual[z, 0.45]], $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 -12200000000000 \lor \neg \left(z \leq 0.45\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -1.22e13 or 0.450000000000000011 < z Initial program 99.9%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -1.22e13 < z < 0.450000000000000011Initial program 94.2%
Taylor expanded in z around 0 82.3%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -14800000000000.0) (not (<= z 1.35e+19))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -14800000000000.0) || !(z <= 1.35e+19)) {
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 <= (-14800000000000.0d0)) .or. (.not. (z <= 1.35d+19))) 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 <= -14800000000000.0) || !(z <= 1.35e+19)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -14800000000000.0) or not (z <= 1.35e+19): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -14800000000000.0) || !(z <= 1.35e+19)) tmp = Float64(x + y); 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 <= -14800000000000.0) || ~((z <= 1.35e+19))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -14800000000000.0], N[Not[LessEqual[z, 1.35e+19]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -14800000000000 \lor \neg \left(z \leq 1.35 \cdot 10^{+19}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.48e13 or 1.35e19 < z Initial program 99.9%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -1.48e13 < z < 1.35e19Initial program 94.4%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*83.0%
Simplified83.0%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -15500000000000.0) (not (<= z 5.5e+18))) (+ x y) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -15500000000000.0) || !(z <= 5.5e+18)) {
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 <= (-15500000000000.0d0)) .or. (.not. (z <= 5.5d+18))) 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 <= -15500000000000.0) || !(z <= 5.5e+18)) {
tmp = x + y;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -15500000000000.0) or not (z <= 5.5e+18): tmp = x + y else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -15500000000000.0) || !(z <= 5.5e+18)) 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 <= -15500000000000.0) || ~((z <= 5.5e+18))) tmp = x + y; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -15500000000000.0], N[Not[LessEqual[z, 5.5e+18]], $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 -15500000000000 \lor \neg \left(z \leq 5.5 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.55e13 or 5.5e18 < z Initial program 99.9%
Taylor expanded in z around inf 77.1%
+-commutative77.1%
Simplified77.1%
if -1.55e13 < z < 5.5e18Initial program 94.4%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*83.0%
Simplified83.0%
add083.0%
clear-num83.0%
un-div-inv83.2%
Applied egg-rr83.2%
add083.2%
Simplified83.2%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.4e+18) (not (<= z 1.5e-49))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.4e+18) || !(z <= 1.5e-49)) {
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 <= (-7.4d+18)) .or. (.not. (z <= 1.5d-49))) 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 <= -7.4e+18) || !(z <= 1.5e-49)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.4e+18) or not (z <= 1.5e-49): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.4e+18) || !(z <= 1.5e-49)) 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 <= -7.4e+18) || ~((z <= 1.5e-49))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.4e+18], N[Not[LessEqual[z, 1.5e-49]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+18} \lor \neg \left(z \leq 1.5 \cdot 10^{-49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.4e18 or 1.5e-49 < z Initial program 99.9%
Taylor expanded in z around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -7.4e18 < z < 1.5e-49Initial program 93.9%
Taylor expanded in x around inf 54.4%
Final simplification64.3%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / (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 * ((t - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{a - z}
\end{array}
Initial program 97.0%
Final simplification97.0%
(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 97.0%
Taylor expanded in x around inf 52.4%
Final simplification52.4%
(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 2024046
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))