
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y (- a t)) (- z t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / (a - t)) * (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 / (a - t)) * (z - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / (a - t)) * (z - t));
}
def code(x, y, z, t, a): return x + ((y / (a - t)) * (z - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / Float64(a - t)) * Float64(z - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / (a - t)) * (z - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a - t} \cdot \left(z - t\right)
\end{array}
Initial program 97.6%
associate-*r/84.6%
Simplified84.6%
associate-/l*97.6%
associate-/r/98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (* y t_1)))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-7) (- x (* t (/ y a))) (if (<= t_1 1e+49) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x - (t * (y / a));
} else if (t_1 <= 1e+49) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = y * t_1
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-7) then
tmp = x - (t * (y / a))
else if (t_1 <= 1d+49) then
tmp = x + y
else
tmp = t_2
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) / (a - t);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x - (t * (y / a));
} else if (t_1 <= 1e+49) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = y * t_1 tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-7: tmp = x - (t * (y / a)) elif t_1 <= 1e+49: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(y * t_1) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = Float64(x - Float64(t * Float64(y / a))); elseif (t_1 <= 1e+49) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = y * t_1; tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = x - (t * (y / a)); elseif (t_1 <= 1e+49) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-7], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+49], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot t\_1\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+49}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 9.99999999999999946e48 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 93.5%
associate-*r/91.9%
Simplified91.9%
associate-/l*93.5%
associate-/r/96.8%
Applied egg-rr96.8%
clear-num96.8%
inv-pow96.8%
Applied egg-rr96.8%
unpow-196.8%
Simplified96.8%
Taylor expanded in y around inf 73.1%
div-sub73.1%
Simplified73.1%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7Initial program 99.8%
Taylor expanded in z around 0 78.7%
mul-1-neg78.7%
unsub-neg78.7%
*-commutative78.7%
associate-/l*85.4%
Simplified85.4%
associate-/r/85.6%
Applied egg-rr85.6%
Taylor expanded in a around inf 85.4%
if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 9.99999999999999946e48Initial program 100.0%
Taylor expanded in t around inf 96.0%
+-commutative96.0%
Simplified96.0%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (* y t_1)))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-7)
(+ x (* (- z t) (/ y a)))
(if (<= t_1 1e+49) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + ((z - t) * (y / a));
} else if (t_1 <= 1e+49) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = y * t_1
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-7) then
tmp = x + ((z - t) * (y / a))
else if (t_1 <= 1d+49) then
tmp = x + y
else
tmp = t_2
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) / (a - t);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + ((z - t) * (y / a));
} else if (t_1 <= 1e+49) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = y * t_1 tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-7: tmp = x + ((z - t) * (y / a)) elif t_1 <= 1e+49: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(y * t_1) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); elseif (t_1 <= 1e+49) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = y * t_1; tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = x + ((z - t) * (y / a)); elseif (t_1 <= 1e+49) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-7], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+49], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot t\_1\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+49}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 9.99999999999999946e48 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 93.5%
associate-*r/91.9%
Simplified91.9%
associate-/l*93.5%
associate-/r/96.8%
Applied egg-rr96.8%
clear-num96.8%
inv-pow96.8%
Applied egg-rr96.8%
unpow-196.8%
Simplified96.8%
Taylor expanded in y around inf 73.1%
div-sub73.1%
Simplified73.1%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7Initial program 99.8%
associate-*r/90.8%
Simplified90.8%
associate-/l*99.8%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in a around inf 98.1%
if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 9.99999999999999946e48Initial program 100.0%
Taylor expanded in t around inf 96.0%
+-commutative96.0%
Simplified96.0%
Final simplification88.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (/ z (/ (- a t) y)))))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-7)
(+ x (* (- z t) (/ y a)))
(if (<= t_1 1.005) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + ((z - t) * (y / a));
} else if (t_1 <= 1.005) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = x + (z / ((a - t) / y))
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-7) then
tmp = x + ((z - t) * (y / a))
else if (t_1 <= 1.005d0) then
tmp = x + y
else
tmp = t_2
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) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + ((z - t) * (y / a));
} else if (t_1 <= 1.005) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = x + (z / ((a - t) / y)) tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-7: tmp = x + ((z - t) * (y / a)) elif t_1 <= 1.005: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(z / Float64(Float64(a - t) / y))) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); elseif (t_1 <= 1.005) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = x + (z / ((a - t) / y)); tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = x + ((z - t) * (y / a)); elseif (t_1 <= 1.005) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-7], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.005], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.1%
Taylor expanded in z around inf 90.9%
*-commutative90.9%
associate-/l*96.4%
Simplified96.4%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7Initial program 99.8%
associate-*r/90.8%
Simplified90.8%
associate-/l*99.8%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in a around inf 98.1%
if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999Initial program 100.0%
Taylor expanded in t around inf 98.8%
+-commutative98.8%
Simplified98.8%
Final simplification97.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (/ z (/ (- a t) y)))))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-7)
(+ x (* y (/ (- z t) a)))
(if (<= t_1 1.005) (+ x y) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x + y;
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = x + (z / ((a - t) / y))
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-7) then
tmp = x + (y * ((z - t) / a))
else if (t_1 <= 1.005d0) then
tmp = x + y
else
tmp = t_2
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) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = x + (z / ((a - t) / y)) tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-7: tmp = x + (y * ((z - t) / a)) elif t_1 <= 1.005: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(z / Float64(Float64(a - t) / y))) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (t_1 <= 1.005) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = x + (z / ((a - t) / y)); tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = x + (y * ((z - t) / a)); elseif (t_1 <= 1.005) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-7], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.005], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.1%
Taylor expanded in z around inf 90.9%
*-commutative90.9%
associate-/l*96.4%
Simplified96.4%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7Initial program 99.8%
Taylor expanded in a around inf 90.2%
+-commutative90.2%
*-lft-identity90.2%
times-frac99.2%
/-rgt-identity99.2%
Simplified99.2%
if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999Initial program 100.0%
Taylor expanded in t around inf 98.8%
+-commutative98.8%
Simplified98.8%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (/ z (/ (- a t) y)))))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-7)
(+ x (* y (/ (- z t) a)))
(if (<= t_1 1.005) (+ x (* y (/ (- t z) t))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = x + (z / ((a - t) / y))
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-7) then
tmp = x + (y * ((z - t) / a))
else if (t_1 <= 1.005d0) then
tmp = x + (y * ((t - z) / t))
else
tmp = t_2
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) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-7) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = x + (z / ((a - t) / y)) tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-7: tmp = x + (y * ((z - t) / a)) elif t_1 <= 1.005: tmp = x + (y * ((t - z) / t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(z / Float64(Float64(a - t) / y))) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (t_1 <= 1.005) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = x + (z / ((a - t) / y)); tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-7) tmp = x + (y * ((z - t) / a)); elseif (t_1 <= 1.005) tmp = x + (y * ((t - z) / t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-7], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.005], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.1%
Taylor expanded in z around inf 90.9%
*-commutative90.9%
associate-/l*96.4%
Simplified96.4%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7Initial program 99.8%
Taylor expanded in a around inf 90.2%
+-commutative90.2%
*-lft-identity90.2%
times-frac99.2%
/-rgt-identity99.2%
Simplified99.2%
if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999Initial program 100.0%
associate-*r/67.5%
Simplified67.5%
associate-/l*100.0%
associate-/r/99.5%
Applied egg-rr99.5%
Taylor expanded in a around 0 66.6%
mul-1-neg66.6%
unsub-neg66.6%
*-lft-identity66.6%
times-frac99.1%
/-rgt-identity99.1%
Simplified99.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (/ z (/ (- a t) y)))))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-12)
(+ x (* y (/ (- z t) a)))
(if (<= t_1 1.005) (- x (* t (/ y (- a t)))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-12) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x - (t * (y / (a - t)));
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = x + (z / ((a - t) / y))
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-12) then
tmp = x + (y * ((z - t) / a))
else if (t_1 <= 1.005d0) then
tmp = x - (t * (y / (a - t)))
else
tmp = t_2
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) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-12) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x - (t * (y / (a - t)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = x + (z / ((a - t) / y)) tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-12: tmp = x + (y * ((z - t) / a)) elif t_1 <= 1.005: tmp = x - (t * (y / (a - t))) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(z / Float64(Float64(a - t) / y))) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-12) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (t_1 <= 1.005) tmp = Float64(x - Float64(t * Float64(y / Float64(a - t)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = x + (z / ((a - t) / y)); tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-12) tmp = x + (y * ((z - t) / a)); elseif (t_1 <= 1.005) tmp = x - (t * (y / (a - t))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-12], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.005], N[(x - N[(t * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x - t \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.1%
Taylor expanded in z around inf 90.9%
*-commutative90.9%
associate-/l*96.4%
Simplified96.4%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999996e-12Initial program 99.9%
Taylor expanded in a around inf 90.7%
+-commutative90.7%
*-lft-identity90.7%
times-frac99.8%
/-rgt-identity99.8%
Simplified99.8%
if 1.99999999999999996e-12 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999Initial program 100.0%
Taylor expanded in z around 0 67.0%
mul-1-neg67.0%
unsub-neg67.0%
*-commutative67.0%
associate-/l*99.1%
Simplified99.1%
associate-/r/98.5%
Applied egg-rr98.5%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- a t))) (t_2 (+ x (/ z (/ (- a t) y)))))
(if (<= t_1 -500.0)
t_2
(if (<= t_1 2e-12)
(+ x (* y (/ (- z t) a)))
(if (<= t_1 1.005) (- x (/ y (/ (- a t) t))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-12) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x - (y / ((a - t) / t));
} else {
tmp = t_2;
}
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 = (z - t) / (a - t)
t_2 = x + (z / ((a - t) / y))
if (t_1 <= (-500.0d0)) then
tmp = t_2
else if (t_1 <= 2d-12) then
tmp = x + (y * ((z - t) / a))
else if (t_1 <= 1.005d0) then
tmp = x - (y / ((a - t) / t))
else
tmp = t_2
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) / (a - t);
double t_2 = x + (z / ((a - t) / y));
double tmp;
if (t_1 <= -500.0) {
tmp = t_2;
} else if (t_1 <= 2e-12) {
tmp = x + (y * ((z - t) / a));
} else if (t_1 <= 1.005) {
tmp = x - (y / ((a - t) / t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) t_2 = x + (z / ((a - t) / y)) tmp = 0 if t_1 <= -500.0: tmp = t_2 elif t_1 <= 2e-12: tmp = x + (y * ((z - t) / a)) elif t_1 <= 1.005: tmp = x - (y / ((a - t) / t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) t_2 = Float64(x + Float64(z / Float64(Float64(a - t) / y))) tmp = 0.0 if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-12) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (t_1 <= 1.005) tmp = Float64(x - Float64(y / Float64(Float64(a - t) / t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); t_2 = x + (z / ((a - t) / y)); tmp = 0.0; if (t_1 <= -500.0) tmp = t_2; elseif (t_1 <= 2e-12) tmp = x + (y * ((z - t) / a)); elseif (t_1 <= 1.005) tmp = x - (y / ((a - t) / t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -500.0], t$95$2, If[LessEqual[t$95$1, 2e-12], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.005], N[(x - N[(y / N[(N[(a - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 94.1%
Taylor expanded in z around inf 90.9%
*-commutative90.9%
associate-/l*96.4%
Simplified96.4%
if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999996e-12Initial program 99.9%
Taylor expanded in a around inf 90.7%
+-commutative90.7%
*-lft-identity90.7%
times-frac99.8%
/-rgt-identity99.8%
Simplified99.8%
if 1.99999999999999996e-12 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999Initial program 100.0%
Taylor expanded in z around 0 67.0%
mul-1-neg67.0%
unsub-neg67.0%
*-commutative67.0%
associate-/l*99.1%
Simplified99.1%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ z t)))))
(if (<= t -1e+187)
(+ x y)
(if (<= t -2e+42)
t_1
(if (<= t -1.35e-14)
(+ x (* z (/ y a)))
(if (<= t -5.7e-68)
t_1
(if (or (<= t -7.5e-83) (not (<= t 1850.0)))
(+ x y)
(+ x (/ z (/ a y))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (z / t));
double tmp;
if (t <= -1e+187) {
tmp = x + y;
} else if (t <= -2e+42) {
tmp = t_1;
} else if (t <= -1.35e-14) {
tmp = x + (z * (y / a));
} else if (t <= -5.7e-68) {
tmp = t_1;
} else if ((t <= -7.5e-83) || !(t <= 1850.0)) {
tmp = x + y;
} else {
tmp = x + (z / (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) :: t_1
real(8) :: tmp
t_1 = x - (y * (z / t))
if (t <= (-1d+187)) then
tmp = x + y
else if (t <= (-2d+42)) then
tmp = t_1
else if (t <= (-1.35d-14)) then
tmp = x + (z * (y / a))
else if (t <= (-5.7d-68)) then
tmp = t_1
else if ((t <= (-7.5d-83)) .or. (.not. (t <= 1850.0d0))) then
tmp = x + y
else
tmp = x + (z / (a / y))
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 / t));
double tmp;
if (t <= -1e+187) {
tmp = x + y;
} else if (t <= -2e+42) {
tmp = t_1;
} else if (t <= -1.35e-14) {
tmp = x + (z * (y / a));
} else if (t <= -5.7e-68) {
tmp = t_1;
} else if ((t <= -7.5e-83) || !(t <= 1850.0)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (z / t)) tmp = 0 if t <= -1e+187: tmp = x + y elif t <= -2e+42: tmp = t_1 elif t <= -1.35e-14: tmp = x + (z * (y / a)) elif t <= -5.7e-68: tmp = t_1 elif (t <= -7.5e-83) or not (t <= 1850.0): tmp = x + y else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(z / t))) tmp = 0.0 if (t <= -1e+187) tmp = Float64(x + y); elseif (t <= -2e+42) tmp = t_1; elseif (t <= -1.35e-14) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= -5.7e-68) tmp = t_1; elseif ((t <= -7.5e-83) || !(t <= 1850.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (z / t)); tmp = 0.0; if (t <= -1e+187) tmp = x + y; elseif (t <= -2e+42) tmp = t_1; elseif (t <= -1.35e-14) tmp = x + (z * (y / a)); elseif (t <= -5.7e-68) tmp = t_1; elseif ((t <= -7.5e-83) || ~((t <= 1850.0))) tmp = x + y; else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+187], N[(x + y), $MachinePrecision], If[LessEqual[t, -2e+42], t$95$1, If[LessEqual[t, -1.35e-14], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.7e-68], t$95$1, If[Or[LessEqual[t, -7.5e-83], N[Not[LessEqual[t, 1850.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{z}{t}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+187}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-14}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 1850\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -9.99999999999999907e186 or -5.7000000000000002e-68 < t < -7.4999999999999997e-83 or 1850 < t Initial program 100.0%
Taylor expanded in t around inf 79.4%
+-commutative79.4%
Simplified79.4%
if -9.99999999999999907e186 < t < -2.00000000000000009e42 or -1.3499999999999999e-14 < t < -5.7000000000000002e-68Initial program 99.9%
Taylor expanded in z around inf 81.0%
Taylor expanded in a around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
*-lft-identity76.9%
times-frac79.9%
/-rgt-identity79.9%
Simplified79.9%
if -2.00000000000000009e42 < t < -1.3499999999999999e-14Initial program 99.9%
Taylor expanded in t around 0 60.7%
+-commutative60.7%
associate-/l*68.3%
Simplified68.3%
associate-/r/76.3%
Applied egg-rr76.3%
if -7.4999999999999997e-83 < t < 1850Initial program 95.2%
Taylor expanded in t around 0 81.3%
+-commutative81.3%
*-lft-identity81.3%
times-frac81.9%
/-rgt-identity81.9%
Simplified81.9%
associate-*r/81.3%
*-commutative81.3%
associate-/l*84.2%
Applied egg-rr84.2%
Final simplification81.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e-83) (not (<= t 0.028))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e-83) || !(t <= 0.028)) {
tmp = x + y;
} else {
tmp = x + ((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 <= (-7.5d-83)) .or. (.not. (t <= 0.028d0))) then
tmp = x + y
else
tmp = x + ((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 <= -7.5e-83) || !(t <= 0.028)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e-83) or not (t <= 0.028): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e-83) || !(t <= 0.028)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e-83) || ~((t <= 0.028))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e-83], N[Not[LessEqual[t, 0.028]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 0.028\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -7.4999999999999997e-83 or 0.0280000000000000006 < t Initial program 99.9%
Taylor expanded in t around inf 71.6%
+-commutative71.6%
Simplified71.6%
if -7.4999999999999997e-83 < t < 0.0280000000000000006Initial program 95.2%
Taylor expanded in t around 0 81.3%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.034) (not (<= t 2400.0))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.034) || !(t <= 2400.0)) {
tmp = x + y;
} else {
tmp = x + (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 <= (-0.034d0)) .or. (.not. (t <= 2400.0d0))) then
tmp = x + y
else
tmp = x + (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 <= -0.034) || !(t <= 2400.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.034) or not (t <= 2400.0): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.034) || !(t <= 2400.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.034) || ~((t <= 2400.0))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.034], N[Not[LessEqual[t, 2400.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.034 \lor \neg \left(t \leq 2400\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -0.034000000000000002 or 2400 < t Initial program 100.0%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.034000000000000002 < t < 2400Initial program 95.8%
Taylor expanded in t around 0 77.5%
+-commutative77.5%
*-lft-identity77.5%
times-frac79.4%
/-rgt-identity79.4%
Simplified79.4%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.049) (not (<= t 28.5))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.049) || !(t <= 28.5)) {
tmp = x + y;
} else {
tmp = x + (z * (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 ((t <= (-0.049d0)) .or. (.not. (t <= 28.5d0))) then
tmp = x + y
else
tmp = x + (z * (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 ((t <= -0.049) || !(t <= 28.5)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -0.049) or not (t <= 28.5): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.049) || !(t <= 28.5)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -0.049) || ~((t <= 28.5))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.049], N[Not[LessEqual[t, 28.5]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.049 \lor \neg \left(t \leq 28.5\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -0.049000000000000002 or 28.5 < t Initial program 100.0%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -0.049000000000000002 < t < 28.5Initial program 95.8%
Taylor expanded in t around 0 77.5%
+-commutative77.5%
associate-/l*79.4%
Simplified79.4%
associate-/r/81.4%
Applied egg-rr81.4%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.95e-88) (not (<= t 3e+110))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.95e-88) || !(t <= 3e+110)) {
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 ((t <= (-1.95d-88)) .or. (.not. (t <= 3d+110))) 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 ((t <= -1.95e-88) || !(t <= 3e+110)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.95e-88) or not (t <= 3e+110): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.95e-88) || !(t <= 3e+110)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.95e-88) || ~((t <= 3e+110))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.95e-88], N[Not[LessEqual[t, 3e+110]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-88} \lor \neg \left(t \leq 3 \cdot 10^{+110}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.94999999999999996e-88 or 3.00000000000000007e110 < t Initial program 99.9%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -1.94999999999999996e-88 < t < 3.00000000000000007e110Initial program 95.6%
Taylor expanded in x around inf 52.1%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 97.6%
Final simplification97.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 97.6%
Taylor expanded in x around inf 49.7%
Final simplification49.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024096
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))