
(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 10 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 (/ (- 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 98.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- t a) t)))))
(if (<= t -2.9e+57)
t_1
(if (<= t -1.8e-35)
(- x (* y (/ z t)))
(if (<= t 9.6e+24) (+ x (* y (/ (- z t) a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((t - a) / t));
double tmp;
if (t <= -2.9e+57) {
tmp = t_1;
} else if (t <= -1.8e-35) {
tmp = x - (y * (z / t));
} else if (t <= 9.6e+24) {
tmp = x + (y * ((z - t) / a));
} 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 / ((t - a) / t))
if (t <= (-2.9d+57)) then
tmp = t_1
else if (t <= (-1.8d-35)) then
tmp = x - (y * (z / t))
else if (t <= 9.6d+24) then
tmp = x + (y * ((z - t) / a))
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 / ((t - a) / t));
double tmp;
if (t <= -2.9e+57) {
tmp = t_1;
} else if (t <= -1.8e-35) {
tmp = x - (y * (z / t));
} else if (t <= 9.6e+24) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((t - a) / t)) tmp = 0 if t <= -2.9e+57: tmp = t_1 elif t <= -1.8e-35: tmp = x - (y * (z / t)) elif t <= 9.6e+24: tmp = x + (y * ((z - t) / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(t - a) / t))) tmp = 0.0 if (t <= -2.9e+57) tmp = t_1; elseif (t <= -1.8e-35) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 9.6e+24) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((t - a) / t)); tmp = 0.0; if (t <= -2.9e+57) tmp = t_1; elseif (t <= -1.8e-35) tmp = x - (y * (z / t)); elseif (t <= 9.6e+24) tmp = x + (y * ((z - t) / a)); 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[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e+57], t$95$1, If[LessEqual[t, -1.8e-35], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.6e+24], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-35}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+24}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9000000000000002e57 or 9.6000000000000003e24 < t Initial program 99.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6482.4%
Simplified82.4%
if -2.9000000000000002e57 < t < -1.80000000000000009e-35Initial program 99.8%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6486.0%
Simplified86.0%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6486.3%
Simplified86.3%
if -1.80000000000000009e-35 < t < 9.6000000000000003e24Initial program 96.9%
Taylor expanded in a around inf
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6479.7%
Simplified79.7%
(FPCore (x y z t a)
:precision binary64
(if (<= x -240000000000.0)
(+ x y)
(if (<= x -1.7e-284)
(* y (- 1.0 (/ z t)))
(if (<= x 1.5e-180) (* y (/ (- z t) a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -240000000000.0) {
tmp = x + y;
} else if (x <= -1.7e-284) {
tmp = y * (1.0 - (z / t));
} else if (x <= 1.5e-180) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-240000000000.0d0)) then
tmp = x + y
else if (x <= (-1.7d-284)) then
tmp = y * (1.0d0 - (z / t))
else if (x <= 1.5d-180) then
tmp = y * ((z - t) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -240000000000.0) {
tmp = x + y;
} else if (x <= -1.7e-284) {
tmp = y * (1.0 - (z / t));
} else if (x <= 1.5e-180) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -240000000000.0: tmp = x + y elif x <= -1.7e-284: tmp = y * (1.0 - (z / t)) elif x <= 1.5e-180: tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -240000000000.0) tmp = Float64(x + y); elseif (x <= -1.7e-284) tmp = Float64(y * Float64(1.0 - Float64(z / t))); elseif (x <= 1.5e-180) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -240000000000.0) tmp = x + y; elseif (x <= -1.7e-284) tmp = y * (1.0 - (z / t)); elseif (x <= 1.5e-180) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -240000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[x, -1.7e-284], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-180], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -240000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-284}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-180}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4e11Initial program 98.5%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6470.4%
Simplified70.4%
if -2.4e11 < x < -1.69999999999999996e-284Initial program 97.4%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6460.0%
Simplified60.0%
Taylor expanded in x around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f6448.0%
Simplified48.0%
if -1.69999999999999996e-284 < x < 1.5e-180Initial program 98.8%
Taylor expanded in a around inf
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6469.4%
Simplified69.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6456.1%
Simplified56.1%
associate-/l*N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
clear-numN/A
/-rgt-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6459.2%
Applied egg-rr59.2%
if 1.5e-180 < x Initial program 98.4%
Taylor expanded in x around inf
Simplified63.6%
Final simplification61.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e+63) (+ x y) (if (<= t 1.9e-301) x (if (<= t 3.95e-144) (/ (* y z) a) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e+63) {
tmp = x + y;
} else if (t <= 1.9e-301) {
tmp = x;
} else if (t <= 3.95e-144) {
tmp = (y * z) / 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 <= (-1.15d+63)) then
tmp = x + y
else if (t <= 1.9d-301) then
tmp = x
else if (t <= 3.95d-144) then
tmp = (y * z) / 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 <= -1.15e+63) {
tmp = x + y;
} else if (t <= 1.9e-301) {
tmp = x;
} else if (t <= 3.95e-144) {
tmp = (y * z) / a;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e+63: tmp = x + y elif t <= 1.9e-301: tmp = x elif t <= 3.95e-144: tmp = (y * z) / a else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e+63) tmp = Float64(x + y); elseif (t <= 1.9e-301) tmp = x; elseif (t <= 3.95e-144) tmp = Float64(Float64(y * z) / a); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.15e+63) tmp = x + y; elseif (t <= 1.9e-301) tmp = x; elseif (t <= 3.95e-144) tmp = (y * z) / a; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e+63], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.9e-301], x, If[LessEqual[t, 3.95e-144], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+63}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-301}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3.95 \cdot 10^{-144}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.14999999999999997e63 or 3.95000000000000026e-144 < t Initial program 99.1%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6466.3%
Simplified66.3%
if -1.14999999999999997e63 < t < 1.89999999999999998e-301Initial program 98.6%
Taylor expanded in x around inf
Simplified46.5%
if 1.89999999999999998e-301 < t < 3.95000000000000026e-144Initial program 93.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6471.2%
Simplified71.2%
Taylor expanded in a around inf
Simplified65.5%
Final simplification59.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) a)))))
(if (<= a -1.2e-121)
t_1
(if (<= a 4.7e-24) (- x (* y (+ -1.0 (/ z t)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / a));
double tmp;
if (a <= -1.2e-121) {
tmp = t_1;
} else if (a <= 4.7e-24) {
tmp = x - (y * (-1.0 + (z / 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))
if (a <= (-1.2d-121)) then
tmp = t_1
else if (a <= 4.7d-24) then
tmp = x - (y * ((-1.0d0) + (z / 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));
double tmp;
if (a <= -1.2e-121) {
tmp = t_1;
} else if (a <= 4.7e-24) {
tmp = x - (y * (-1.0 + (z / t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / a)) tmp = 0 if a <= -1.2e-121: tmp = t_1 elif a <= 4.7e-24: tmp = x - (y * (-1.0 + (z / t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / a))) tmp = 0.0 if (a <= -1.2e-121) tmp = t_1; elseif (a <= 4.7e-24) tmp = Float64(x - Float64(y * Float64(-1.0 + Float64(z / 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)); tmp = 0.0; if (a <= -1.2e-121) tmp = t_1; elseif (a <= 4.7e-24) tmp = x - (y * (-1.0 + (z / 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] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.2e-121], t$95$1, If[LessEqual[a, 4.7e-24], N[(x - N[(y * N[(-1.0 + N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a}\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.7 \cdot 10^{-24}:\\
\;\;\;\;x - y \cdot \left(-1 + \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.20000000000000002e-121 or 4.69999999999999992e-24 < a Initial program 99.1%
Taylor expanded in a around inf
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6482.9%
Simplified82.9%
if -1.20000000000000002e-121 < a < 4.69999999999999992e-24Initial program 97.1%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6488.9%
Simplified88.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.1e-35) (- x (* y (/ z t))) (if (<= t 3.8e+126) (+ x (* y (/ (- z t) a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.1e-35) {
tmp = x - (y * (z / t));
} else if (t <= 3.8e+126) {
tmp = x + (y * ((z - 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 <= (-2.1d-35)) then
tmp = x - (y * (z / t))
else if (t <= 3.8d+126) then
tmp = x + (y * ((z - 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 <= -2.1e-35) {
tmp = x - (y * (z / t));
} else if (t <= 3.8e+126) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.1e-35: tmp = x - (y * (z / t)) elif t <= 3.8e+126: tmp = x + (y * ((z - t) / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.1e-35) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 3.8e+126) tmp = Float64(x + Float64(y * Float64(Float64(z - 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 <= -2.1e-35) tmp = x - (y * (z / t)); elseif (t <= 3.8e+126) tmp = x + (y * ((z - t) / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.1e-35], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+126], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-35}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+126}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.1e-35Initial program 99.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6487.8%
Simplified87.8%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6476.7%
Simplified76.7%
if -2.1e-35 < t < 3.80000000000000017e126Initial program 97.3%
Taylor expanded in a around inf
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.1%
Simplified77.1%
if 3.80000000000000017e126 < t Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6493.7%
Simplified93.7%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e-27) (- x (* y (/ z t))) (if (<= t 3.8e+126) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e-27) {
tmp = x - (y * (z / t));
} else if (t <= 3.8e+126) {
tmp = x + (y * (z / 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 <= (-7.5d-27)) then
tmp = x - (y * (z / t))
else if (t <= 3.8d+126) then
tmp = x + (y * (z / 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 <= -7.5e-27) {
tmp = x - (y * (z / t));
} else if (t <= 3.8e+126) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.5e-27: tmp = x - (y * (z / t)) elif t <= 3.8e+126: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e-27) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 3.8e+126) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.5e-27) tmp = x - (y * (z / t)); elseif (t <= 3.8e+126) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e-27], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+126], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-27}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+126}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.50000000000000029e-27Initial program 99.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6487.8%
Simplified87.8%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6476.7%
Simplified76.7%
if -7.50000000000000029e-27 < t < 3.80000000000000017e126Initial program 97.3%
Taylor expanded in t around 0
/-lowering-/.f6473.2%
Simplified73.2%
if 3.80000000000000017e126 < t Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6493.7%
Simplified93.7%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -3e+82) (+ x y) (if (<= t 3.8e+126) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e+82) {
tmp = x + y;
} else if (t <= 3.8e+126) {
tmp = x + (y * (z / 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 <= (-3d+82)) then
tmp = x + y
else if (t <= 3.8d+126) then
tmp = x + (y * (z / 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 <= -3e+82) {
tmp = x + y;
} else if (t <= 3.8e+126) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3e+82: tmp = x + y elif t <= 3.8e+126: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e+82) tmp = Float64(x + y); elseif (t <= 3.8e+126) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3e+82) tmp = x + y; elseif (t <= 3.8e+126) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e+82], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.8e+126], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+82}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+126}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.99999999999999989e82 or 3.80000000000000017e126 < t Initial program 100.0%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6484.5%
Simplified84.5%
if -2.99999999999999989e82 < t < 3.80000000000000017e126Initial program 97.6%
Taylor expanded in t around 0
/-lowering-/.f6471.2%
Simplified71.2%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -1e+79) x (if (<= a 2.3e+33) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1e+79) {
tmp = x;
} else if (a <= 2.3e+33) {
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 (a <= (-1d+79)) then
tmp = x
else if (a <= 2.3d+33) 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 (a <= -1e+79) {
tmp = x;
} else if (a <= 2.3e+33) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1e+79: tmp = x elif a <= 2.3e+33: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1e+79) tmp = x; elseif (a <= 2.3e+33) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1e+79) tmp = x; elseif (a <= 2.3e+33) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1e+79], x, If[LessEqual[a, 2.3e+33], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+79}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+33}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.99999999999999967e78 or 2.30000000000000011e33 < a Initial program 98.7%
Taylor expanded in x around inf
Simplified60.1%
if -9.99999999999999967e78 < a < 2.30000000000000011e33Initial program 98.0%
Taylor expanded in t around inf
+-commutativeN/A
+-lowering-+.f6451.2%
Simplified51.2%
Final simplification54.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 98.3%
Taylor expanded in x around inf
Simplified45.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 2024191
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))